12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace App\Http\Controllers;
- use App\Product;
- use Illuminate\Http\Request;
- class ProductCntrl extends Controller
- {
-
- public function index()
- {
- $products =new Product;
- $category = new Category;
- $category->id = 1;
- $products->id = 1;
- $products->categories()->attach([$category->id,$products->id]);
- $prd = Product::with('categories')->get();
- return view('welcome',['products'=>$prd]);
- }
-
- public function create()
- {
-
- }
-
- public function store(Request $request)
- {
-
- }
-
- public function show($id)
- {
-
- }
-
- public function edit($id)
- {
-
- }
-
- public function update(Request $request, $id)
- {
-
- }
-
- public function destroy($id)
- {
-
- }
- }
|