image = $image; $this->video = $video; $this->auteur = $auteur; } /** * Returns count of file. * * @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.image.gadget', $count = 10) { if (User::hasRole('user')) { $this->image->pushCriteria(new \Litepie\File\Repositories\Criteria\ImageUserCriteria()); } $image = $this->image->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('file::' . $view, compact('image'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.video.gadget', $count = 10) { if (User::hasRole('user')) { $this->video->pushCriteria(new \Litepie\File\Repositories\Criteria\VideoUserCriteria()); } $video = $this->video->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('file::' . $view, compact('video'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.auteur.gadget', $count = 10) { if (User::hasRole('user')) { $this->auteur->pushCriteria(new \Litepie\File\Repositories\Criteria\AuteurUserCriteria()); } $auteur = $this->auteur->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('file::' . $view, compact('auteur'))->render(); } }