Ok so trying to submit a form in Laravel, but keep getting this issu
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message
I check all my code to see what could be the problem, I even tried the command php artisan route:list and signup route shows up
welcome.blade.php
<form action="{{ URL('signup') }}" method="post">
<div class="form-group">
<label for="email">You'r E-Mail</label>
<input class="form-control" type="text" name="email"
id="email">
</div>
<div class="form-group">
<label for="first_name">You'r First Name</label>
<input class="form-control" type="text"
name="first_name" id="first_name">
</div>
<div class="form-group">
<label for="password">You'r Password</label>
<input class="form-control" type="password"
name="password" id="password">
</div>
<button type="submit" class="btn btn-
primary">Submit</button>
<input type="hidden" name="_token" value="
{{Session::token() }}">
</form>
routes/web.php
Route::group(['middleware' => ['web']],function(){
Route::get('/',function() {
return view('welcome');
});
Route::post('/signup',[
'uses'=>'UserController@postSignUp',
'as'=>'signup'
]);
});
Controllers/UserController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function postSignUp(Request $request)
{
$email = $request['email'];
$first_name = $request['first_name'];
$password = bcrypt($request['password']);
$user = new User();
$user->email = $email;
$user->first_name = $first_name;
$user->password = $password;
$user->save();
}
public function postSignIn(Request $request)
{
}
}
After pressing submit button it should add to my xampp database I have running locally