lets say I have 7 columns in table, and I want to select only two of them, something like this
SELECT `name`,`surname` FROM `table` WHERE `id` = '1';
在laravelEloquent 的模型中,它可能看起来是这样的
Table::where('id', 1)->get();
但我猜这个表达式会 Select id等于1的所有列,我只想要两列(名字、姓氏).如何只 Select 两列?