You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement this package in the latest Laravel framework and I'm running into an issue. This is the current code for retrieving parameters from the configuration, as part of the AuthServiceProvider class in this package:
private static function createEloquentLdapProvider($app)
{
$config = $app['config'];
$ldap = $config['auth.ldap'];
$model = $config['auth.model'];
return new EloquentLdapUserProvider($ldap, $app['hash'], $model);
}
In Laravel 5.2, they have moved some of the settings around, and the model setting is no longer accessible via auth.model. An example of the providers array from Laravel 5.2, customized for use with this package, is shown below:
As a result of this change, when Laravel attempts the retrieveByCredentials() method on the EloquentUserProvider class, it calls the createModel() method, which fails since the $model variable that was passed in is null (since it was read incorrectly from the config).
I can change the path to the model config entry, but since providers can be added/removed, this particular fix only works if you use the default users provider:
$model = $config['auth.providers.users.model'];
I assume a proper fix would be getting the active provider and then reading the model from the array that way, but I'm not familiar enough with the code to submit that as a pull request, sorry!
The text was updated successfully, but these errors were encountered:
I'm trying to implement this package in the latest Laravel framework and I'm running into an issue. This is the current code for retrieving parameters from the configuration, as part of the AuthServiceProvider class in this package:
In Laravel 5.2, they have moved some of the settings around, and the model setting is no longer accessible via auth.model. An example of the providers array from Laravel 5.2, customized for use with this package, is shown below:
As a result of this change, when Laravel attempts the retrieveByCredentials() method on the EloquentUserProvider class, it calls the createModel() method, which fails since the $model variable that was passed in is null (since it was read incorrectly from the config).
I can change the path to the model config entry, but since providers can be added/removed, this particular fix only works if you use the default users provider:
$model = $config['auth.providers.users.model'];
I assume a proper fix would be getting the active provider and then reading the model from the array that way, but I'm not familiar enough with the code to submit that as a pull request, sorry!
The text was updated successfully, but these errors were encountered: