Answers for "laravel eloquent get only field name"

PHP
1

laravel eloquent get only field name

//Eloquent: Get specific columns (not all the row). Pluck returns an array.
Model::where('id', 1)->pluck('name', 'surname');
// If you only want to get the result value:
Model::where('id', 1)->value('name');
Posted by: Guest on May-17-2020

Code answers related to "laravel eloquent get only field name"

Browse Popular Code Answers by Language