Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

theUnforgiven's avatar

Ziggy url edit, Inertia/Jetstream

I have the following routes:

Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified', 'isSubscribed'])
    ->group(function() {
        Route::get('/', [PropertyController::class, 'index'])->name('properties.index');
        Route::post('/', [PropertyController::class, 'store'])->name('properties.store');
        Route::get('/create', [PropertyController::class, 'create'])->name('properties.create');

        Route::get('properties/{uuid}/edit', [PropertyController::class, 'edit'])->name('properties.edit');
           
});

But yet trying <Link :href="route('properties.edit', { uuid: property.uuid })">Edit</Link>

I get:

Error: Ziggy error: 'uuid' parameter is required for route 'properties.edit'.

I have a 'prop' called property on the page so it should be there, it's almost like it's not registered, but it's there in the routes and shows up on route:list.

Any one got any ideas what this could be please?

0 likes
13 replies
tykus's avatar

Likely because for the Link you're trying to generate, the property.uuid is null?

tykus's avatar

@theUnforgiven that Blade example you have shown is not the same URL; the Route definition does not have an /edit segment.

It is irrelevant in any case; can you inspect the property Object in your JS app to see what value the uuid property has?

tykus's avatar

@theUnforgiven It is irrelevant in any case; can you inspect the property Object in your JS app to see what value the uuid property has?

theUnforgiven's avatar

I'm still getting Error: Ziggy error: 'uuid' parameter is required for route 'properties.edit'. after everything I have tried, clear cache, routes etc

theUnforgiven's avatar

I can confirm all is there:

property:Object
address_id:1
available_from:null
bathrooms:null
bedrooms:null
created_at:"2023-06-15T20:58:02.000000Z"
status:"tenanted"
team_id:1
tenants:Array[1]
type:"Detached"
updated_at:"2023-06-15T20:58:02.000000Z"
uuid:"1d581588-2d9c-4a3e-af37-34faddc35bbd"
theUnforgiven's avatar
theUnforgiven
OP
Best Answer
Level 51

Seems wrapping the route around a prefix and changin to ID solves this:

Route::prefix('{id?}')->group(function () {
            Route::get('/edit', [PropertyController::class, 'edit'])->name('edit');
        });
tykus's avatar

@theUnforgiven that doesn't look like a solution... were you iterating over a Collection of properties earlier, or was there only one?

theUnforgiven's avatar

There was only one, a link to edit the property from the listing page, whereas adding the above seems to have solved this. Bizarre I know....

theUnforgiven's avatar

I'm still encountering this issue, when doing {id}/edit etc always shows Error: Ziggy error: 'uuid' parameter is required for route 'properties.edit'.

My routes looks like:

Route::middleware([config('jetstream.auth_session'),'verified'])
    ->prefix('properties')
    ->name('properties.')
    ->group(function() {
        Route::get('/', [PropertyController::class, 'index'])->name('index');
        Route::post('/', [PropertyController::class, 'store'])->name('store');
        Route::get('/create', [PropertyController::class, 'create'])->name('create');

        Route::prefix('{uuid}')->group(function () {
            Route::get('/edit', [PropertyController::class, 'edit'])->name('edit');
        });
});

So there's a prefix and a name, each routes is named, yet php artisan ziggy:generate doesn't seem to solve anything.

Setting using the Link directive: <Link :href="route('properties.edit', {uuid: property.uuid})"> {{ property.address.line1 }}, {{ property.address.postcode }} </Link>

However navigating to that page shows nothing but the error above.

theUnforgiven's avatar

Removing the name around the grouping and setting individual routes, seems to work

Please or to participate in this conversation.