📜  如何提取全名数据库 laravel - PHP 代码示例

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

代码示例1
public function getFullNameAttribute()
    {
        return "{$this->first_name} {$this->last_name}";
    }
  

      $agents = User::whereId($agent->id)->get()->pluck('full_name', 'id');


      $agents = json_decode(json_encode($agents), true);