Issue
It's not working showing this
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The POST method is not supported for this route. Supported methods: PUT, PATCH, DELETE.
<form class="form-ad" action="{{ route('jobs.store') }}" method="post" >
Solution
Fake your patch request like this in form tag
<form class="form-ad" action="{{ route('jobs.store') }}" method="post" >
{{ method_field('POST') }} /*here i used post and solved the error*/ /*if you are using form method POST then what is the use of using {{method_field('POST')}} form "store" action? {{method_field('POST')}} is mainly used if you have a PATCH request for update action. Store action is already on POST request in your Routes.*/
<!-- rest of the form -->
</form>
Also, just a suggestions that you can simply make a resource full route.
First make a controller resourceful from artisan command, which will create all the methods required for each method (get, post, patch etc.)
php artisan make:controller Jobs -r
then in your routes/web.php use
Routes::resource('jobs');
You can also view your routes using php artisan command
php artisan route:list
Answered By - Danish Hakim Khan
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.