samedi 17 octobre 2015

Order by translated column using laravel-translatable in Laravel 5.1

I am using Laravel 5.1 with laravel-translatable module.

I am trying to order the query by translated column without joining the translations table and specifying the locale.

Example:

Tables: "page" (id, timestamps) and "page_translations" (id, page_id, locale, title, body, timestamps)

I would like to achive something like Page::orderBy('title', 'asc')->paginate(25);

It works fine without specifying order.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire