mardi 3 avril 2018

Laravel - Routes not working (Not found)

I have a working route as

Route::get('/{url}', 'Controller@view)->name('view')->where('url', '[\w\d\-]+(.*)');

This works perfectly and shows the page as below (just demo page): Demo Landing Page

I have a link on this page to place a order and I want to create a route as

Route::get('/{url}/order', 'Controller@order)->name('order')->where('url', '[\w\d\-]+(.*)');

View Blade

<a href="">Order Now</a>

php artisan route:list

|    | GET|HEAD | {slug}        | view   | App\Http\Controllers\Controller@view    | web   |
|    | GET|HEAD | {slug}/order  | order  | App\Http\Controllers\Controller@order   | web   |

Whenever I click on this link Laravel returns Not Found Error. What is issue? I restarted server & checked for Mod_rewrite. Everything is fine.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire