📌  相关文章
📜  laravel eloquent 只获取字段名 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:34.835000             🧑  作者: Mango

代码示例1
//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');