/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\RedirectResponse */ public function getDelete($id = 0) { $image = $this->image->findOrFail($id); unlink(public_path("images/" . $image['file'])); $image->delete(); $msg = 'Image was deleted successfully!'; return redirect()->action('Admin\\ImageController@index')->with('success', $msg); }
/** * 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); }