floorplan = $floorplan; $this->project = $project; $this->unit = $unit; $this->booking = $booking; } /** * Returns count of offplan. * * @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.floorplan.gadget', $count = 10) { if (User::hasRole('user')) { $this->floorplan->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\FloorplanUserCriteria()); } $floorplan = $this->floorplan->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('offplan::' . $view, compact('floorplan'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.project.gadget', $count = 10) { if (User::hasRole('user')) { $this->project->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\ProjectUserCriteria()); } $project = $this->project->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('offplan::' . $view, compact('project'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.unit.gadget', $count = 10) { if (User::hasRole('user')) { $this->unit->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\UnitUserCriteria()); } $unit = $this->unit->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('offplan::' . $view, compact('unit'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.booking.gadget', $count = 10) { if (User::hasRole('user')) { $this->booking->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\BookingUserCriteria()); } $booking = $this->booking->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('offplan::' . $view, compact('booking'))->render(); } }