I have a sign-up form and getting the sign-up form values in routes.php
.
My rout.php
code is :
Route::get('/', function () {
return view('login');
});
Route::get('/index', function(){
return view('index');
});
Route::get('/register', function(){
return view('register');
});
Route::post('/register',function(){
$user = new \App\User;
$user->username = input::get('username');
$user->email = input::get('email');
$user->password = Hash::make(input::get('username'));
$user->designation = input::get('designation');
$user->save();
});
The form action is to index.php and also have hidden field for csrf_token():
<form action="index" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
The error is :
Method Not Allowed Http Exception in Route Collection.php line 201: