📜  结合 2 列搜索查询 laravel - PHP 代码示例

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

代码示例1
public function index()
{
    $users = User::select("*", DB::raw("CONCAT(users.first_name,' ',users.last_name) as full_name"))
        ->get();
  
    return view('home', compact('users'));
}