Need help for my sql query to make use of AS operator [duplicate]

Published

I’m new to Laravel. Can anyone please let me know how to use "AS" operator for table ‘products’ in below SQL query?

$obj = new Product();
$main_data = $obj
->select('products.*','t2.title')
->leftJoin('category as t2', 't2.id', '=', 'products.subcategory_id')
->where('products.status',1); 

Source: Laravel

Published
Categorised as controller, laravel, mysql, object, php Tagged , , , ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq