📜  laravel 选择自定义列 - PHP 代码示例

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

代码示例1
$products = Product::select([
                            "id", 
                            "name", 
                            DB::raw("'10%' as tax"),
                            DB::raw("1 as active")
                        ])->get();