Skip to content
Selahattin edited this page Oct 2, 2015 · 1 revision

This package creates eloquent query from uri parameters.

Example

/api/users?name=se*&age!=18&order_by=age,asc&limit=2&columns=name,age,city_id&includes=city

The resulting query:

Users::with(['city'])->select(['name', 'age', 'city_id'])
                     ->where('age', '!=', 18)
                     ->where('name', 'like', 'se%')
                     ->orderBy('age', 'asc')
                     ->take(2)