Complete BLoC with Clean Architecture (group chat) Discount !! E-commerce App With Backend Source Code Video and Voice Chatting App Firebase Chatting App Source Code Complete Gym App BLoC State Management Source Code Complete Study App Buy Ticket Booking App Source Code Buy Travel App With Backend Source Code Complete Chat App Udemy Course Special Offer Discount !! Online Learning Course App (BLoC) Online Learning Course App (Riverpod) Online Learning Course App (Getx) Discount !! Shopping App (Provider) Cool Flutter Game Flutter Nodejs Chat App Flutter Nodejs Api And Firebase Chat App Riverpod Task Management App
Laravel Select() and Get() method and differences. Sometimes we get confused how to use select() and get() method or Laravel eloquent.
select() method select bunch of columns of your eloquent or database table. It does not return anything. It's just select. So if you use like below
It will just return empty response. See the below picture
So now, we understand select() will not return anyting without get() method.
get() method is more powerful than select() method. It can return all the rows from the eloquent or database table. This method can work alone with select() method. See the get() method, inside it you can mention the database columns just like select() method.
And now see the response
From this we understand you can work without select() method.
get() returns a collection of rows, you may mention colmun inside it
select() just select columns inside a row
With get() method, you also choose to skip any column names, then it will return all the columns from the database row.