mongodb – PHP Laravel blade dynamic table with database data?-ThrowExceptions

Exception or error:

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

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *