The AppServ Open Project - 8.6.0 for Windows Now you running on PHP 5.6.30
The problem is that all data and data are being called, but the problem is that the image is not being called
--my items--
<div class="items_parent">
@if(count($data)>0)
@foreach($data as $i)
<!-- start item div -->
<div class="item_part">
<img src=""
width="200" height="200"/>
<b id="price">EGP.</b>
<b id="name"></b>
<b id="unit"></b>
<p id="desc"> </p>
<a href="s_edit_item"></a>
{!! Form::open(['url' => 'all_items','files'=>true]) !!}
{!! Form::close() !!}
</div>
<!-- end of item div-->
@endforeach
@endif
</div>
--supplier code-- //Here is the code for adding products
public function add_item(Request $req){
$req->validate([
'i_name'=>'required',
'i_price'=>'required',
'i_size'=>'required',
'i_unit'=>'required',
'i_cat'=>'required',
'i_short'=>'required',
'i_full'=>'required',
'i_photo'=>'required'
]);
$i=new item;
$email=$req->session()->get('supplier');
$i->supplier=$email;
$i->name=$req->input('i_name');
$i->price=$req->input('i_price');
$i->size=$req->input('i_size');
$i->unit=$req->input('i_unit');
$i->category=$req->input('i_cat');
$i->short_desc=$req->input('i_short');
$i->full_desc=$req->input('i_full');
$i->image_url=$req->file('i_photo')->store('items_photo','public'); //fule upload= store
$i->save(); //insert
return redirect('s_setting');
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire