Search code examples
phplaravel-5.3cartalyst-sentinel

UnexpectedValueException in Response.php line 403 - Laravel 5.3


I am new to Laravel and am building a small project as my schooling. I have struck the above error and I cannot seem to fix it. Any help is appreciated.

I am using sentinel package for authentication.

Web.php

Route::post('/login' , 'LoginController@login');

LoginController.php

public function login(Request $request){
       Sentinel::authenticate($request->all());
       return Sentinel::check();

}

When I click on submit button then this error showing:

UnexpectedValueException in Response.php line 403: The Response content must be a string or object implementing __toString(), "boolean" given.


Solution

  • Finally i solved the problem .

    Actually i forget to replace email to username in EloquentUser.php because i am using username unique rather than email .

     protected $loginNames = ['email']; ->  protected $loginNames = ['username'];