userable_type == Student::class) { return Subject::whereIn('id', Auth::user()->userable->grade->subjects->pluck('id')) ->filter() ->paginate(5) ->withQueryString(); } return Subject::filter()->paginate(5)->withQueryString(); } }