Answers for "laravel eloquent get column"

PHP
1

laravel eloquent get column

//return array of json
Model::where('id', 1)->get(['column1','column2']);
or
Model::all(['column1']);
//return array
Model::whereNull('deleted_at')->pluck('column1');
Posted by: Guest on March-23-2021

Code answers related to "laravel eloquent get column"

Browse Popular Code Answers by Language