it's my first time making a log in laravel. I followed the steps here: https://scotch.io/tutorials/simple-and-easy-laravel-login-authentication. But this error comes out:
I'm really confused what this error is about since I'm new to laravel? Here is my controller code:
public function login()
{
$admins = Admin::all();
$validator = \Validator::make($admins , ['username' => 'required', 'password' => 'required']);
if ($validator->passes())
{
$userdata = array(
'username' => Admin::get('username'),
'password' => Admin::get('password'));
if (Auth::attempt($userdata))
{
echo 'Success';
}
else {
return Redirect::to('login');
}
}
}
Here is my route:
Route::resource('Admins','AdminController');
Route::post('login', array('uses' => 'AdminController@login'));
via Eymiєl Moralєs