**I have a problem with the products View **
Code is in productsdash.blade.php
**
@if (count($products) > 0)
@foreach ($products as $product)
<tr>
<th scope="row">1</th>
<td></td>
<td></td>
<td></td>
</tr>
@endforeach
@else
<div class="alert alert-danger" role="alert">
No Products Found
</div>
@endif
**
controller index Method
public function index()
{
$products=Product::all();
return view('pages.productsdash',compact('products'));
}
controller Store Method
public function store(Request $request){
$product=new Product();
$product->name=$request->input('name');
$product->category=$request->input('category');
$product->condition=$request->input('condition');
$product->price=$request->input('price');
$product->platform=$request->input('platform');
$product->description=$request->input('description');
$product->save();
return redirect('/Products')->with('success','Product Added');
}
I don't know what is a problem on my problem
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2G656WO
via IFTTT
Aucun commentaire:
Enregistrer un commentaire