/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $paket1 = Paket::where('type', 1)->get(); $paket2 = Paket::where('type', 2)->get(); $paket_list = Paket::lists('name', 'id'); $galerys = Galery::all(); return view('frontend.welcome', compact('paket1', 'paket2', 'galerys', 'paket_list')); }
public function destroy(Request $request) { $row = json_decode($request->input()['models'])[0]; $galery = Galery::find($row->id); return json_encode($galery->delete()); }