I want to pass the 'CourseId' variable from a page view to a controller in order to delete it, but not sure why I can't access the variable:
view:
this.$inertia.get(this.route('applications.courseDelete', CourseId ))
route:
Route::get('applications/courseDelete', [ApplicationsController::class, 'courseDelete'])->name('applications.courseDelete')->middleware('auth');
controller:
public function courseDelete($courseId)
{
dd($courseId);
}
this returns the error, 'too few arguments...'. ive tried adding the model here also, but returns a blank array. sure i'm missing something very obvious here?
Route::post('applications/courseDelete/{courseId}', [ApplicationsController::class, 'courseDelete'])->name('applications.courseDelete')->middleware('auth');also change it topostordeletenotgetin order to send variable