/** * @param Episode $episode * @param Anime $anime * @param Page $page * @param Option $option */ public function __construct(Episode $episode, Anime $anime, Page $page, Option $option) { $this->episode = $episode; $this->anime = $anime; $this->page = $page; $this->option = $option; $this->data['animeBanner'] = $this->anime->orderByRaw("RAND()")->where('type2', '=', 'subbed')->take(1)->first(); $this->data['topPagesList'] = $this->page->where('position', '=', 'top')->orderBy('order')->get(); $this->data['bottomPagesList'] = $this->page->where('position', '=', 'bottom1')->orderBy('order')->get(); $this->data['bottomPagesList2'] = $this->page->where('position', '=', 'bottom2')->orderBy('order')->get(); $this->data['bottomPagesList3'] = $this->page->where('position', '=', 'bottom3')->orderBy('order')->get(); $this->data['options'] = $this->option->all(); }
public function getRelatedForEachAnime(Collection $animes) { $relations = ['prequel', 'sequel', 'story', 'side_story', 'spin_off', 'alternative', 'other']; foreach ($animes as $key => $anime) { foreach ($relations as $relation) { if ($anime[$relation]) { $animesRelated = explode(',', $anime[$relation])[0]; $anime[$relation] = $this->anime->where('id', '=', $animesRelated)->first(); } } $animes[$key] = $anime; } return $animes; }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\View\View */ public function getEdit($id = 0) { $this->data['animes'] = $this->anime->orderBy('title', 'ASC')->get(); $this->data['episode'] = $this->episode->findOrFail($id); $this->data['user'] = $this->auth->user(); return view('admin.episodes.edit', $this->data); }
/** * Create a new page error composer. * @param Page $page * @param Option $option * @param Anime $anime */ public function __construct(Page $page, Option $option, Anime $anime) { $this->page = $page; $this->option = $option; $this->anime = $anime; $this->data['options'] = $this->option->all(); $this->data['animeBanner'] = $this->anime->orderByRaw("RAND()")->where('type2', '=', 'subbed')->take(1)->first(); $this->data['topPagesList'] = $this->page->where('position', '=', 'top')->orderBy('order')->get(); $this->data['bottomPagesList'] = $this->page->where('position', '=', 'bottom1')->orderBy('order')->get(); $this->data['bottomPagesList2'] = $this->page->where('position', '=', 'bottom2')->orderBy('order')->get(); $this->data['bottomPagesList3'] = $this->page->where('position', '=', 'bottom3')->orderBy('order')->get(); $this->data['pageTitle'] = $pageTitle = "Sorry, the page you have requested cannot be found."; $this->data['metaTitle'] = $pageTitle; $this->data['metaDesc'] = $pageTitle; $this->data['metaKey'] = $pageTitle; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function getDelete($id = 0) { $anime = $this->anime->findOrFail($id); $anime['image'] ? unlink(public_path("images/" . $anime['image'])) : ''; $anime->delete(); $msg = 'Anime was deleted successfully!'; return redirect()->action('Admin\\AnimeController@index')->with('success', $msg); }
public function getLatest() { $this->data['animes'] = $this->anime->orderBy('id', 'DESC')->paginate(20); $this->data['pageTitle'] = "Latest Anime | Watch Anime Online Free"; $this->data['metaTitle'] = "Watch the Latest Anime for Free Online | Watch Anime Online Free just in Animecenter.tv"; $this->data['metaDesc'] = "Watch Latest Anime added to the site! Latest English Subbed/Dubbed Anime"; $this->data['metaKey'] = "Latest Anime, Watch Latest Anime, Watch on Iphone, Watch Anime" . " Online, English Subbed/Dubbed"; return view('anime.latest', $this->data); }
/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index() { $this->data['pageTitle'] = "Home"; $this->data['desc'] = "Home Page"; $this->data['animesCount'] = $this->anime->where('position', '=', 'recently')->orWhere('position', '=', 'all')->get()->count(); $this->data['episodesList'] = $this->episode->with('anime')->where('show', '=', 1)->orderBy('date', 'DESC')->take('12')->get(); $this->data['imagesList'] = $this->image->orderBy('date', 'DESC')->take(10)->get(); $this->data['topPagesList'] = $this->page->where('position', '=', 'top')->orderBy('order')->get(); $this->data['bottomPagesList'] = $this->page->where('position', '=', 'bottom1')->orderBy('order')->get(); $this->data['bottomPagesList2'] = $this->page->where('position', '=', 'bottom2')->orderBy('order')->get(); $this->data['bottomPagesList3'] = $this->page->where('position', '=', 'bottom3')->orderBy('order')->get(); $this->data['options'] = $this->option->all(); $this->data['animeList'] = $this->anime->where('position', '=', 'recently')->orWhere('position', '=', 'all')->orderBy('id', 'DESC')->take(8)->get(); $this->data['upcomingEpisodes'] = $this->episode->with('anime')->where('coming_date', '<>', '')->where('not_yet_aired', '<>', '')->orderBy('coming_date', 'ASC')->take(6)->get(); $this->data['pageTitle'] = $title = "AnimeCenter: Watch Anime English Subbed/Dubbed Online in HD"; $this->data['metaTitle'] = "Watch Anime Online English Subbed/Dubbed | Watch Anime Online Free"; $this->data['metaDesc'] = "Watch Anime English Subbed/Dubbed Online in HD at AnimeCenter! Over 41000 Episodes" . ", and 2,146 Anime Series!"; $this->data['metaKey'] = "Watch Anime Online, Anime Subbed/Dubbed, Anime Episodes, Anime Stream, " . "Subbed Anime, Dubbed Anime"; return view('home.index', $this->data); }