/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $servers = Server::paginate(1); $news = Category::where('type', NEWS_CAT)->where('status', 1)->first(); $galaries = Galary::where('status', 1)->get(); $articles = Category::getPostAvaiable($news); return view('frontend.index.main')->with('news_articles', $articles)->with('news', $news)->with("galaries", $galaries)->with('servers', $servers); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $galary = Galary::findOrFail($id); $galary->delete(); return redirect()->route('admin.galaries.index')->with(['message' => 'Delete success!']); }
/** * Run the database seeds. * * @return void */ public function run() { Galary::truncate(); $data = [['title' => "NẠP THẺ LẦN ĐẦU", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary1.jpg'], ['title' => "ĐẢ THÔNG KINH MẠCH", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary2.jpg'], ['title' => "VÒNG QUAY MAY MẮN", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary3.jpg'], ['title' => "TRỢ THỦ ĐẠI HIỆP", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary1.jpg'], ['title' => "MÁY CHỦ MỚI THẦN KIẾM", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary2.jpg'], ['title' => "ĐUA TOP SERVER MỚI", 'status' => 1, 'image_url' => 'frontend/images/galaries/galary3.jpg']]; Galary::insert($data); }