diff --git a/app/Http/Controllers/fireFightersController.php b/app/Http/Controllers/fireFightersController.php index 3a3fecb..37afd87 100644 --- a/app/Http/Controllers/fireFightersController.php +++ b/app/Http/Controllers/fireFightersController.php @@ -15,7 +15,11 @@ class fireFightersController extends Controller if(auth()->user() != null && auth()->user()->fireStationID != null ){ // $users = user::where("fireStationID", auth()->user()->fireStationID)->get(); - $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID)->get(); +// $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID)->get(); + $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID) + ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') + ->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id') + ->get(); return view("fireFighters", ["users" => $users]); } else{ return view('fireFighters'); diff --git a/app/ranks.php b/app/ranks.php new file mode 100644 index 0000000..18cde60 --- /dev/null +++ b/app/ranks.php @@ -0,0 +1,13 @@ +id }}">{{ $user->surname }}