Я использую 2 таблицы при отображении моих пользователей в моих пользователях> index.blade
эти 2
Таблица USER
и таблица COLLECTOR_MEMBERS

В результате получается

Теперь моя проблема в том, что я хочу подключиться к другой таблице с именем
Таблица COMMISSIONS

, чтобы добиться этого результат

МОДЕЛИ
КОМИССИЯ Модель

ПОЛЬЗОВАТЕЛЬ

ЧЛЕН КОЛЛЕКТОРА

Функция индекса USER Controller
public function index(Request $request)
{
$users = User::all();
$admins = User::whereHas('roles', function ($q) {
$q->where('roles.name', '=', 'admin');
})->get();
$collectorList = User::whereHas('roles', function ($q) {
$q->where('roles.name', '=', 'collector');
})->with('collectorList')->get();
$borrowers = User::whereHas('roles', function ($q) {
$q->where('roles.name', '=', 'borrower');
})->get();
$userProfile = Auth::user()->id;
if (Auth::User()->hasRole(['borrower','collector'])){
return redirect('dashboard/profile/'.$userProfile);
}
return view('dashboard.users.index', compact('users','profile'))
->with('admins',$admins)
->with('borrowers',$borrowers)
->with('collectorList',$collectorList);
// ->with('collectorBorrowers',$collectorBorrowers);
}
Как мне отобразить столбец Commission_amount из таблицы комиссий? сделать мой список таким:
