plan = $plan; $this->location = $location; $this->crew = $crew; $this->passenger = $passenger; $this->floatpassenger = $floatpassenger; $this->users = $users; $this->manager = $manager; } /** * Returns count of plan. * * @param array $filter * * @return int */ public function count() { return 0; } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.plan.gadget', $count = 10) { if (User::hasRole('user')) { $this->plan->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\PlanUserCriteria()); } $plan = $this->plan->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('plan'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.location.gadget', $count = 10) { if (User::hasRole('user')) { $this->location->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\LocationUserCriteria()); } $location = $this->location->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('location'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.crew.gadget', $count = 10) { if (User::hasRole('user')) { $this->crew->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\CrewUserCriteria()); } $crew = $this->crew->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('crew'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.passenger.gadget', $count = 10) { if (User::hasRole('user')) { $this->passenger->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\PassengerUserCriteria()); } $passenger = $this->passenger->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('passenger'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.floatpassenger.gadget', $count = 10) { if (User::hasRole('user')) { $this->floatpassenger->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\FloatpassengerUserCriteria()); } $floatpassenger = $this->floatpassenger->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('floatpassenger'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.users.gadget', $count = 10) { if (User::hasRole('user')) { $this->users->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\UsersUserCriteria()); } $users = $this->users->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('users'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.manager.gadget', $count = 10) { if (User::hasRole('user')) { $this->manager->pushCriteria(new \Litepie\Moblyze\Repositories\Criteria\ManagerUserCriteria()); } $manager = $this->manager->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('plan::' . $view, compact('manager'))->render(); } }