I am getting the "MethodNotAllowedHttpException" error on form submit, but I can't figure out why. Here is my form, created with Laravel Collective form creator:
{!! Form::open(['url' => 'photographer/listing/store', 'method'=>'POST', 'files' => true]) !!}
//Bunch of Form Inputs here:
{!!Form::submit('Create Listing')!!}
{!! Form::close() !!}
Then here is my route:
Route::post('photographer/listing/store', 'PhotographerController@storeListing');
And Finally, here is the controller:
class PhotographerController extends Controller
{
public function storeListing(Request $request)
{
//Form Validation
//Store in the database
return redirect('/photographer');
}
}
From what I have seen, this error comes up when you use the incorrect method for the request, ex. route is a get where form is a post, but that isn't the case here, so I don't really know what is going on.
Update: I am also including the relevant information from php artisan route:list as well here:
POST | photographer/listing/store | | App\Http\Controllers\PhotographerController@storeListing | web,auth:photographer
GET|HEAD | photographer | photographer.dashboard | App\Http\Controllers\PhotographerController@index | web,auth:photographer
['url' => '/photographer/listing/store' ...]. I'd even suggest you to name your routes and call them withroute(name). - DevK'url' => url( 'photographer/listing/store')- Peymanphp artisan route:list. can you see your route? - Peyman