Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $allproduct = Products::all();
     return view('Panel.AdminPanel', ['allproduct' => $allproduct]);
 }
Exemplo n.º 2
0
 /**
  * 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");
 }
Exemplo n.º 3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $product = Products::findOrFail($id);
     return response()->json($product);
 }