Api call is not working, It's giving me error that organizationId does not exist but it exist in my database, in end there is database tables and call

Viewed 23

This is my api Call and under is the method I have made:

 Route::get('/curriculums/{curriculumId}/grades', [CurriculumController::class, 'getGradesByCurriculum']);

Method:

public function getGradesByCurriculum(Request $request)
    {
        $org = auth()->user()->organization;

        return Grade::without('curriculum')->where([
            'organizationId' => $org->id,
            'curriculumId' => $request->curriculumId,
        ])->get();
    }

enter image description hereenter image description here tables

0 Answers
Related