Home > Software engineering >  removing question mark from the end of URLs in Laravel
removing question mark from the end of URLs in Laravel

Time:05-19

I'm new to laravel and I'm working on building a crud application. Here is my web.php file with all the routes. web.php file

For the creae, show, and edit GET routes, when I go to those routes on the browser, I see a "?" at the end of URLs, such as "localhost:3000/positiontypes.create?". I've been trying to figure out how to remove it from there but no success so far. Any help would be greatly appreciated!

CodePudding user response:

Form will do a submit action and it will pass form attributes so it's setting a ? mark and as no attributes in that form so only ? mark is present in URL. Use anchor tag instead of a form. It will solve your issue.

<a href="{{ route('positiontypes.show', ['id' => $positiontype->id]) }}">Show </a>
  • Related