Skip to content

L5.2 authentication #114

@patrickbrouwers

Description

@patrickbrouwers

From upgrade guide:

Custom Drivers

If you are using the Auth::extend method to define a custom method of retrieving users, you should now use Auth::provider to define your custom user provider. Once you have defined the custom provider, you may configure it in the providers array of your new auth.php configuration file.

For more information on custom authentication providers, consult the full authentication documentation.

Will become something like this:

$this->app->make('auth')->provider('doctrine', function ($app, $config) {

            $entity = $config['model'];

            $em = $app['registry']->getManagerForClass($entity);

            if (!$em) {
                throw new InvalidArgumentException("No EntityManager is set-up for {$entity}");
            }

            return new DoctrineUserProvider(
                $app['hash'],
                $em,
                $entity
            );
        });

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions