Update your users migration file to include
$table->rememberToken();
Laravel requires remember_token column
thanks for your answer, but this error come : Call to undefined method User::newQuery()
You have a csrf token in your input. Remove it from the input you are passing to attempt.
Input::except('_token');
Input::only('username', 'password');
When you are adding extra fields to that attempt it will use them as conditions.
this is my code .. but ,it not word :(
public function Home()
{
if(Auth::attempt(Input::only('username', 'password')))
{
return Input::get('username');
}
else {
return 'You are Guest';
}
}
please help me
my username and password in users db is : mahshid , 1234(hashed)
app/models/User.php
class User .... {
protected $fillable = ['username', 'password', etc...];
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community