i'm trying to create a custom check with laravel. I adding this in LoginController
public function customchecker()
{
$credentials = [
'username' => Input::get('username'),
'password' => Input::get('password')
];
if (Auth::attempt($credentials)) {
return Redirect::to('account')->with('alert-success', 'You are now logged in.');
$errors = new MessageBag(['password' => ['Email and/or password invalid.']]);
return Redirect::back()->withErrors($errors)->withInput(Input::except('password'));
}
}
and here is my route
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::get('customchecker','LoginController@customchecker')->name('customchecker');
But i get an error , here is my error
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message
so, how can i fix this ?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iSJp4m
via IFTTT
Aucun commentaire:
Enregistrer un commentaire