In general, the controller sends 2 arrays to the view
class Admin_controller extends Controller { public function monitoring_user() { $data=[ 'users'=> User::join('user_info', 'users.id', '=', 'user_id')->get(), 'role' => Role::join('users_roles','roles.id','=','role_id')->get() ]; return view('monitoring_user' ,$data); And in it is necessary to process in one iteration 2 arrays
@if (count($users)) @foreach($users as $user) <tr> <td><center>{!! $user->login !!}</center></td> <td><center>{!! $user->name !!}</center></td> <td><center>{!! $user->surname !!}</center></td> <td><center>{!! $user->patronymicname !!}</center></td> /// <td><center>{!! $role->name !!}</center> <td> @endforeach I’m sorting out users well, but I also need to bring the roles right there I apologize for the crooked explanation and for my ignorance
@foreach- u_mulder nested