Exemplo n.º 1
3
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @param  array                    $role
  *
  * @return mixed
  */
 public function handle($request, Closure $next, $role)
 {
     if (Sentinel::inRole($role)) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             Flash::error('You do not have te right permissions to go there.');
             return redirect()->route('/', Config::get('app.locale'));
         }
     }
     return $next($request);
 }
Exemplo n.º 2
-1
 /**
  * Архив заказов
  *
  * @return \Illuminate\View\View
  */
 public function getArchive()
 {
     $this->page->title = 'Заказы такси';
     $this->page->desc = 'Архив заказов';
     // АДМИНИСТРАТОР Текущие заказы
     if (Sentinel::inRole('admin')) {
         $this->data['orders'] = Order::whereRaw('order_status = 3 AND payment_status = 1 AND (departure_time < now() and arrivals_time < now())')->orderBy('created_at', 'DESC')->get();
     } else {
         $this->data['orders'] = Order::whereRaw('order_status = 3 AND payment_status = 1 AND (departure_time < now() and arrivals_time < now())')->where('user_id', Sentinel::getUser())->orderBy('created_at', 'DESC')->get();
     }
     // АДМИНИСТРАТОР отображение
     return $this->render('order.list-archive');
 }