Exemple #1
0
 /**
  * index.
  *
  * Get an overview off the trips. To the refugee camps.
  *
  * @param null $selector
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index($selector = null)
 {
     $data['title'] = trans();
     // Trips counts
     $data['all'] = Trips::paginate(15);
     $data['calais'] = Trips::where('destination', 1)->get();
     $data['duinkerke'] = Trips::where('destination', 2)->get();
     // Data selection
     if ($selector == 'calais') {
         $data['query'] = $data['calais'];
     } elseif ($selector == 'duinkerke') {
         $data['query'] = $data['duinkerke'];
     } else {
         $data['query'] = $data['all'];
     }
     return view('frontend.trips', $data);
 }
Exemple #2
0
 /**
  * changeApiCredentialsView.
  *
  * [REQUEST] - GET
  *
  * the view for the api credential setting.
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function changeApiCredentialsView()
 {
     $data['title'] = 'Account settings -' . Auth::user()->name;
     $data['query'] = Trips::where('user_id', Auth::user()->id)->get();
     $data['tab'] = 2;
     return view('backend.profile', $data);
 }