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’)
->get();

Links:

http://stackoverflow.com/questions/15533659/sorting-data-with-eloquent

10 quick tips to get better at Laravel http://tech.knolskape.com/10-quick-tips-to-get-better-at-laravel/

Laravel Eloquent vs Fluent query builder http://blog.sriraman.in/laravel-eloquent-vs-fluent-query-builder/

Laravel’s Eloquent ORM versus Query Builder http://www.rogerpence.com/2013/07/29/laravels-eloquent-orm-versus-query-builder/

Univerzális Entitás Kezelés: http://files.meetup.com/15327232/Perger_Peter_-_Univerzalis_entitas_kezeles-L4R4VELBP.pdf

Blogbook : PHP | Javascript | Laravel | Corcel | CodeIgniter | VueJs | ReactJs | WordPress