/** * Update the specified resource in storage. * * @param Request $request * @return \Illuminate\Http\RedirectResponse */ public function postEdit(Request $request) { $options = $this->option->all(); if ($request['title'] !== $options[0]['value']) { $option = $this->option->findOrFail(1); $option->value = $request['title']; $option->save(); } if ($request['text'] !== $options[1]['value']) { $option = $this->option->findOrFail(2); $option->value = $request['text']; $option->save(); } if ($request['subbed'] !== $options[2]['value']) { $option = $this->option->findOrFail(3); $option->value = $request['subbed']; $option->save(); } if ($request['dubbed'] !== $options[3]['value']) { $option = $this->option->findOrFail(4); $option->value = $request['dubbed']; $option->save(); } if ($request['episode'] !== $options[4]['value']) { $option = $this->option->findOrFail(5); $option->value = $request['episode']; $option->save(); } $msg = "Options were updated successfully"; return redirect()->back()->with('success', $msg); }
/** * @param Anime $anime * @param Page $page * @param Option $option */ public function __construct(Anime $anime, Page $page, Option $option) { $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(); }
/** * 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; }
/** * 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); }