stackers I'm facing a problem on displaying data from query that contain join statement.
public function view(Request $id)
{
$user_id = $id->input('id');
$users = DB::table('users')->select('*')
->leftjoin('role_user', 'users.id', '=', 'role_user.user_id')
->leftjoin('roles', 'roles.id', '=', 'role_user.role_id')
->where('users.id', '=', $user_id)->get();
return view('/admin/view_user', ['users' => $users]);
}
From the above code, how do i display the row and the join table data from roles, and role_user
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TFTBqz
via IFTTT
Aucun commentaire:
Enregistrer un commentaire