Reputation: 947
I have multiple tables say Users , Location, terms and services i want to make a mysql view because every time i have to make a join statement for fetching the desired result. please help how to get it accomplished? Thanks!
Upvotes: 0
Views: 344
Reputation: 121
Are you asking how to create a view or read it Laravel?
CREATE VIEW vw_MyView AS
You could use Query Builder
$rows = \DB::select('select * from vw_MyView');
foreach ($rows as $row) {
var_dump($row->field);
}
Upvotes: 1