Search code examples
phprouteslaravel-5.3

Laravel routes not working properly


In Laravel, If I call a url from controller it didn't work properly. For example I am in this location like example.com/dev/lar/public/index.php/location/{$id}. Now I am redirection to following routes location/create . For example url will be <a href="location/create"></a> . Then url shows example.com/dev/lar/public/index.php/location/location/create.

My web file is given below.

Route::get("location/all","LocationController@showall");
Route::resource("location","LocationController");

Update : I updated my error message in screenshot Error message screenshot is given below.

[img]https://i.sstatic.net/cnKUO.png


Solution

  • I just use URL::to('location/create') function. Then route works. This solution was suggested by @lea Tanao