src/Authentication/Providers/UserProviderDB.php
public function retrieveByCredentials(array $credentials) {
    	$u = $credentials['username'];
    	$p = $credentials['password'];

    	$m = $this->modelName;

    	// attempt to auth with the credentials provided
    	try
    	{
    		// build the query to retrieve the model instance
    		$user = $m::where($this->username, $u)
    			->first();
    		
    		// if the user is empty then we don't even need to check the
    		// password and we can just return null
    		if(empty($user)) {
    			return null;
    		}

    		// now check the password if we need to do so
    		if(!$this->allow_no_pass) {
    			$pw_attr = $this->password;
    			if(!Hash::check($p, $user->$pw_attr)) {
    				// passwords do not match
    				return null;
    			}
    		}

    		// the authentication was successful
    		return $user;
    	}
    	catch(Exception $e)
    	{
    		// DB access failure, so bubble up the exception
    		// instead of letting it die here; this will assist in debugging
    		throw $e;
    	}
    }
public function retrieveByCredentials(array $credentials) {
    	$u = $credentials['username'];
    	$p = $credentials['password'];

    	$m = $this->modelName;

    	// attempt to auth with the credentials provided
    	try
    	{
    		// build the query to retrieve the model instance
    		$user = $m::where($this->username, $u)
    			->first();
    		
    		// if the user is empty then we don't even need to check the
    		// password and we can just return null
    		if(empty($user)) {
    			return null;
    		}

    		// now check the password if we need to do so
    		if(!$this->allow_no_pass) {
    			$pw_attr = $this->password;
    			if(!Hash::check($p, $user->$pw_attr)) {
    				// passwords do not match
    				return null;
    			}
    		}

    		// the authentication was successful
    		return $user;
    	}
    	catch(Exception $e)
    	{
    		// DB access failure, so bubble up the exception
    		// instead of letting it die here; this will assist in debugging
    		throw $e;
    	}
    }
public function retrieveByCredentials ( array $ credentials ) { $ u = $ credentials [ 'username' ] ; $ p = $ credentials [ 'password' ] ; $ m = $ this -> modelName ; // attempt to auth with the credentials provided try { // build the query to retrieve the model instance $ user = $ m :: where ( $ this -> username , $ u ) -> first ( ) ; // if the user is empty then we don't even need to check the // password and we can just return null if ( empty ( $ user ) ) { return null ; } // now check the password if we need to do so if ( ! $ this -> allow_no_pass ) { $ pw_attr = $ this -> password ; if ( ! Hash :: check ( $ p , $ user -> $ pw_attr ) ) { // passwords do not match return null ; } } // the authentication was successful return $ user ; } catch ( Exception $ e ) { // DB access failure, so bubble up the exception // instead of letting it die here; this will assist in debugging throw $ e ; } }
Retrieves the user with the specified credentials from the database.
Returns null if the model instance could not be found.

@param array $credentials The credentials to use
@return User|boolean|null
Retrieves the user with the specified credentials from the database . Returns null if the model instance could not be found .