when I click on submit button it gives an error token mismatch, I can't understand why it gives me this error
here is my rout
Route::get('admin-login', array('uses' => 'adminController@showlogin'));
// route to process the form
Route::post('admin-login', array('uses' => 'adminController@dologin'));
my controller
public function dologin(){
$uname = Input::get('username');
$password = Input::get('password');
if (Auth::attempt(array('username' => $uname, 'password' => $password))){
return "success";
}
else {
return "Wrong Credentials";
}
}
my form
<form role="form" method="post" action="">
<input name="_token" hidden value="{{ csrf_token() }} " />
<div class="form-group">
<label for="username">UserName: </label>
<input type="text" class="form-control" id="username" name="username">
</div>
<div class="form-group">
<label for="password">Password: </label>
<input type="password" class="form-control" id="password" name="password">
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
here is error
TokenMismatchException in VerifyCsrfToken.php line 53: