If you are select data from database. So use this code to display your fetch result in your view page:
Open view page and follow example code here I have four column like Name, Address, Email and Phone no. You only put the column name which is related to your MySQL table column.
Example Code:
<table class="table"> <thead> <tr> <th> Name </th> <th> Address </th> <th> Email Id </th> <th> Phone No </th> </tr> </thead> <tbody> @foreach ($data as $val) <tr> <td>{{$val->name}}</td> <td>{{$val->address}}</td> <td>{{$val->email}}</td> <td>{{$val->phone}}</td> </tr> @endforeach </tbody> </table>
If you need to help to select user data from MySQL table then you need follow this example code.
Controller:
<?php public static function user_table(){ $data=with(new User)->getUserData(); return view('user_table')->with('data',$data); } ?>
Model:
<?php $data=DB::table('table_name')->get(); return $data; ?>
Question and answer is powered by AnsPress.io