Ejemplo n.º 1
0
 /**
  * Show the Administrator panel.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     try {
         $user = Auth::user()->with('projects')->where('id', '=', '2')->firstOrFail();
     } catch (ModelNotFoundException $e) {
         return Redirect::home();
     }
     // if it's admin, redirect to admin cms with all users but admin
     $allUsers = User::whereNotIn('id', [2])->get();
     $allSponsors = Sponsor::all();
     // Retrieve all projects pending approval.
     $pendingProjects = Project::where('approved', '=', '0')->where('application_status', '=', '1')->where('live', '=', '0')->get();
     return view('adminpanel.index', compact('user', 'allUsers', 'pendingProjects', 'allSponsors'));
 }
 public function editSponsors($id)
 {
     $expedition = Expedition::findOrFail($id);
     $sponsors = Sponsor::all();
     return view('admin.expeditions.sponsors')->with(compact('expedition', 'sponsors'));
 }
Ejemplo n.º 3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sponsors = Sponsor::all()->load('applicants');
     return $sponsors;
 }