[Vuejs]-Laravel Vue POST to api uses web route instead of api route

0👍

Change Your routes to this :

Route::prefix('/record')->group(function(){
   Route::post('/store', [MusicItemController::class, 'store'])->name('music.store');
   Route::put('/{id}', [MusicItemController::class, 'update']);
   Route::delete('/{id}', [MusicItemController::class, 'destroy']);
});
Route::get('/records', [MusicItemController::class, 'index']);

Leave a comment