Skip to content
Advertisement

Route is redirecting to wrong page

I’m working on Laravel 5 and I’ve set up the routes for all the pages. I have a dashboard that has certain icons which when clicked redirects to different pages. Now, this particular icon “Total Applications” is when clicked doesn’t redirect to the page associated with it, i.e., total.blade.php but instead redirects to another page candidate.blade.php.

I’m new to Laravel. I want that when I click the “Total Applications” page it should redirect to the page designated for it.

I’m sharing the codes below:

dashboard.blade.php file:

JavaScript

Route file containing routes for both the pages:-

JavaScript

My controller containing the logic for Total Applications page:-

JavaScript

Advertisement

Answer

Ok. let’s explain this

JavaScript

this route accepts a parameter status like

JavaScript

what about total-applications could it be the parameter? yes it could be why not so the route will be

example.com/total-applications which redirects to FrontendEmployersController@candidatesDisplay which leads to candidate.blade.php not total.blade.php you can solve it by adding any prefix before {status}

Note that any endpoint you call it will fall into that route /{status} as this route accepts any path you will hit.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement