You need to make sure that you are implementing the retrieveById function on your LdapUserProvider as this is what Laravel uses to populate the user field on the Guard on each request.
/**
* Retrieve a user by their unique identifier.
*
* @param mixed $identifier
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveById($identifier){
}
You might also want to create an extension of Illuminate\Auth\GenericUser and override the getAuthIdentifierName method to return the primary key field of your table/model
/**
* Get the name of the unique identifier for the user.
*
* @return string
*/
public function getAuthIdentifierName()
{
return 'id';
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community