Likely because for the Link you're trying to generate, the property.uuid is null?
Jun 27, 2023
13
Level 51
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?
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');
});
Please or to participate in this conversation.