Laravel Eloquent ORM and Query Builder

Using Query Builder is easy way and complicated writing.

I had thought that I couldn’t use Eloquent ORM for complicated query but I found the solution.

A code snippet:

$bid_products = Bid::with(array(‘Product’ =>
            function($query){$query->orderBy(‘title’, ‘ASC’);}))
->where(‘admin_id’, ‘=’, $admin_id)->orderBy(‘bids.created_at’, ‘desc’)


10 quick tips to get better at Laravel

Laravel Eloquent vs Fluent query builder

Laravel’s Eloquent ORM versus Query Builder

Univerzális Entitás Kezelés:

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress

Translate »