Hello All
I'm building an Inertia app and am having issues with the update.
here is the component:
const form = useForm({
_method: 'patch',
name: null,
description: null,
uuid: null
})
const props = defineProps({
player: {
type: Object,
required: true
}
})
onMounted(() => {
form.name = props.player.name
form.description = props.player.description
form.uuid = props.player.uuid
})
function submit() {
form.post('/digital-signage/players', form)
}
Here is the route file ,
Route::get('/players' , [PlayerController::class, 'index'])->name('digital-signage/players');
Route::patch('/players/{player}' , [PlayerController::class, 'update'])->name('digital-signage/players/update');
Route::get('/players/create' , [PlayerController::class, 'create'])->name('digital-signage/players/create');
Route::post('/players' , [PlayerController::class, 'store'])->name('digital-signage/players/store');
Route::get('/players/{player}' , [PlayerController::class, 'show'])->name('digital-signage/players/show');
Route::get('/players/{player}/edit' , [PlayerController::class, 'edit'])->name('digital-signage/players/edit');
Route::delete('/players/{player}' , [PlayerController::class, 'destroy'])->name('digital-signage/players/destroy');
and the error:
The PATCH method is not supported for route digital-signage/players. Supported methods: GET, HEAD, POST.
not sure what I'm doing wrong, I've tried to change the route from patch to post, and have run optimize to clear the caches.