Answers for "laravel get certain columns"

PHP
1

eloquent get only some columns

Table::select('name','surname')->where('id', 1)->get();
Posted by: Guest on June-30-2020
0

eloquest how to select one specific column in database

$result = DB::Table('table_name')->select('column1','column2')->where('id',1)->get();
Posted by: Guest on June-10-2020
1

laravel get certain columns

ModelName::all('column1', 'column2', 'column3');
Posted by: Guest on May-05-2021

Code answers related to "laravel get certain columns"

Browse Popular Code Answers by Language