returns a value of some value to 1 value only in laravel -


say have following:

    id directorate     1  corporate     2  corporate     3  corporate     4  network     5  network 

what want query return is:

1  corporate 2  network 

how describe query

as elias commented:

$result = yourmodel::groupby('directorate')->get(); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

recursion - Can every recursive algorithm be improved with dynamic programming? -