2017 © Pedro Peláez
 

library session-user

Authenticated User injection for auto resolving IOCs

image

baileylo/session-user

Authenticated User injection for auto resolving IOCs

  • Friday, September 12, 2014
  • by baileylo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SessionUser

An easy way to inject the authenticated User into your Controllers., (*1)

Installation

Step 1: Install the package

Add this line to your composer.json, (*2)

"baileylo/session-user": "1.0.0"

Or, use the commandline:, (*3)

composer require baileylo/session-user

Step 2: Register the Service Provider(Laravel Specific)

Edit your app/config/app.php file and add this line to the providers array:, (*4)

'Portico\SessionUser\LaravelSessionUserProvider'

Step 3: Update your User Object

Add the following interface to your User model/entity,, (*5)

\Portico\SessionUser\SessionUser

So your class may now look like this, (*6)

<?php

use Portico\SessionUser\SessionUser;

class User extends Eloquent Implements SessionUser

Usage

In controllers where all functions require authentication you can update the constructor to pass in the authenticated user., (*7)

<?php

use Portico\SessionUser\SessionUser;

class MyController {
    protected $user;
    public function __construct(SessionUser $user)
    {
        $this->user = $user;
    }
}

The Versions

12/09 2014

dev-master

9999999-dev

Authenticated User injection for auto resolving IOCs

  Sources   Download

MIT

The Development Requires

by Logan Bailey

12/09 2014

dev-develop

dev-develop

Authenticated User injection for auto resolving IOCs

  Sources   Download

MIT

The Development Requires

by Logan Bailey

12/09 2014

1.0.0

1.0.0.0

Authenticated User injection for auto resolving IOCs

  Sources   Download

MIT

The Development Requires

by Logan Bailey