vendredi 13 mars 2020

PHP Laravel blade dynamic table with database data?

I am NEW on PHP Laravel6 , i want to make blade view table dynamically..how should i show data in table form with key value pairs data from database? How should i write the blade code foreach loop,with dynamic headings and correspondings rows..

  1. My Controller code..
public function getDashboardData(){
     $sales = ExcelData::all()->toArray();
     return view('sales.sales_dashboard',compact('sales'));
}

2.My view blade table code...

<table class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td></td>
                </tr>    
                </tbody>
            </table>

2. My data coming from databse this formate headings and their coresponding values in array form data coming from databse keys and values pairs



via Chebli Mohamed

1 commentaire:

bezz a dit…

have you solve this?

Enregistrer un commentaire