/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $allproduct = Products::all(); return view('Panel.AdminPanel', ['allproduct' => $allproduct]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $product = Products::findOrFail($id); $product->delete(); return redirect("Product"); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $product = Products::findOrFail($id); return response()->json($product); }