I am new at PHP , I am not able to connect my form with database . NotFoundHttpException in RouteCollection.php line 179:
320
**Please Help me with my form connection to database, table is created in database but i am confused how to connect it with my form **
This is my how i am routing my form
<div id="register" class="animate form">
<form action="{{route('signup')}}" method="post" autocomplete="on">
<h1> Sign up </h1>
this is my controller
public function postSignup(Request $request)
{
$username = $request['username'];
$email = $request['email'];
$password = bcrypt($request['password']);
$user = new User();
$user->username = $username;
$user->email = $email;
$user->password = $password;
$user->save();
return redirect()->back();
}
and here comes my route file :
Route::post('/signup',[
'uses' => [email protected],
'as'=> 'signup'
]);
Answer
Solution:
Your form like this:-
And try this route:-
Hope it helps!