jeudi 31 janvier 2019

Laravel Eloquent Distinct

i have this table

int id
string title
string year // maybe i'll change this to int??

and i want to loop my data without using another table to create a relationship using Year.

i want an output like this

2018 
 - title1
 - title2
 - title3

i know select distinct and then i have to create another query by the data i collect on select distinct.my question is this possible in eloquent and how? Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire