I have an issue in my laravel 5.2 project.
The main page has a form which post to the following URL
myapp.com/check
So i created a route for this like:
Route::post('/check', 'StatusController@index')->name('StatusPost');
When i open the home page, the form action URL is like:
http://myapp.com/check/
Here is the form code:
{!! Form::open(array('url' => route('StatusPost'), 'method' => 'post')) !!}
......
{!! Form::close() !!}
The problem is that laravel did not recognize the http://myapp.com/check/
, if i remove the slash at the end, it works correctly.
EDIT
Route.php file:
Route::get('/', 'HomepageController@index')->name('home');
Route::get('/about', function () {
return View::make('pages.about');
});
Route::get('/terms', function () {
return View::make('pages.terms');
});
Route::get('/help', function () {
return View::make('pages.help');
});
Route::get('/privacy', function () {
return View::make('pages.privacy');
});
Route::post('/check', 'StatusController@index')->name('StatusPost');
Route::get('/{product}', 'StatusController@index')->where('product', '(.*)')->name('productStatus');
Any help to resolve this issue?
Thanks
productStatus
route,Route::get('/{product}', ...
– karimRoute::post('/check')
andRoute::get('/{product}')
– Wreigh