L o a d i n g
Laravel Tip (Select Columns using eloquent all method) BackEnd Development

Laravel Tip (Select Columns using eloquent all method)

Select Columns through Laravel Eloquent

Now we can select the columns to run the when using the Model::all() method. No Need to use additional select() method

//Instead of this
$users = User::select(['id','name','email']) >get();
//Use this one
$users = User::all(['id','name','email']);
Enter fullscreen mode Exit fullscreen mode