dimanche 3 septembre 2017

How to get all seller product sold by the seller via id

I have 2 table which is product and seller table. Example like, page A will list all product for seller A and so on ..

Web .php

Route::get('/sellitem/{user_id}', 'PsController@sellitem')->name('sellitem');

sellitem.blade.php

    @foreach ($user_id as $user_id)
        <div class="searchable-container">
            <div class="items col-xs-12 col-sm-6 col-md-6 col-lg-6 clearfix">
               <div class="info-block block-info clearfix">
                    <div class="square-box pull-left">
                        <span class="glyphicon glyphicon-user glyphicon-lg"></span>
                    </div>
                    <h5></h5>
                    <h5><img src="" height="100" width="100"/> </h5>
                    <h5>Sold by : </h5>
                    <h4>  <div class="panel-body"> </h4>

                </div>
            </div>

@endforeach

Pscontroller.php

public function sellitem(){  $user_id = DB::table('product')->get();


  return view('sellitem', ['user_id' => $user_id]);}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire