mercredi 16 novembre 2022

My Laravel Links keep breaking Each time I restart my server

My Laravel links keep breaking each time I restart my local server

So, I am using Laravel 9 and my links keep breaking each time I reload the page or when I restart the server For example

127.0.0.1:8000/cars/1/edit

will become 127.0.0.1:8000/cars/cars/1/edit next time I click it.

I have searched for a solution and stumbled upon this On every click link changes in blade view

But the problem is that the guy that asked the question is using named routes from web.php route

I, on the other hand, am using resource routes ( I do not know what to call them = Route::resource('/cars', CarsController::class);)Resouce route

For that reason, I'm finding it difficult to implement the route() solution proposed as his had a named route name

The href I want to make changes to looks like this. I am using resources routes in web.php

<a href="cars//edit">Edit &rarr;</a>

Href I want to edit



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire