Exemplo n.º 1
0
 /**
  * Display a listing of all crews (requires a global_admin user)
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     if (!Auth::user()->isGlobalAdmin()) {
         // Only Global Admins can access this
         return redirect()->back()->withErrors("Unauthorized");
     }
     $crews = Crew::orderBy('name', 'asc')->get();
     $request->session()->flash('active_menubutton', 'crews');
     // Tell the menubar which button to highlight
     return view('crews.index', ['crews' => $crews]);
 }
Exemplo n.º 2
0
 public function index(Request $request)
 {
     if (!Auth::user()->isGlobalAdmin()) {
         // Only Global Admins can access this
         return redirect()->back()->withErrors("Unauthorized");
     }
     // Authorization complete - continue...
     $users = User::orderBy('firstname', 'asc')->orderBy('lastname', 'asc')->get();
     $crews = Crew::orderBy('name')->get();
     $request->session()->flash('active_menubutton', 'accounts');
     // Tell the menubar which button to highlight
     return view('auth.index', ['users' => $users, 'crews' => $crews]);
 }