i have team table and member table and pivot table that has both tables.
in my controller i have the following:
$teams = Team::all();
$teams->load(['members' => function ($q) {
$q->orderBy('id', 'desc')->paginate(6);
}]);
so after i navigate into my view, it's works and shows 6 members but when i code {{ $teams->members_paginated }} in my view it gives me this error
Undefined property: Illuminate\Database\Eloquent\Collection::$members_paginated (View: /var/www/html/Al Muktar/resources/views/frontend/other/committee-words.blade.php)
so my question how to render that many to many eager loading into my view like {{ $teams->members_paginated }}
thanks