php - Laravel route function add extra slash to url -
i have issue in laravel 5.2 project. main page has form post following url myapp.com/check
created route like:
route::post('/check', 'statuscontroller@index')->name('statuspost');
when open home page, form action url like:
http://myapp.com/check/
here form code:
{!! form::open(array('url' => route('statuspost'), 'method' => 'post')) !!} ...... {!! form::close() !!}
the problem laravel did not recognize http://myapp.com/check/
, if remove slash @ end, 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 resolve issue?
thanks
route route::resource -> statuscontroller ?
Comments
Post a Comment