I would like to sort items by column relation in laravel (5.1)
I have a database table called interests, with a column called 'town_searched' and I would like to sort interests by town_searched in my view
When I have all interests, How can I order by town_searched ?
Example of the result I want in my view :
In the town of Sydney :
In the town of New-York :
My controller :
$userid = \Auth::id();
$interests = DB::table('interests')
->where('user_id', $userid)
->groupBy('town_searched')
->get();
Thanks for your help ! :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community