how to pluck fullname database laravel

Solutions on MaxInterview for how to pluck fullname database laravel by the best coders in the world

showing results for - "how to pluck fullname database laravel"
Clara
22 Jun 2019
1    public function getFullNameAttribute()
2    {
3        return "{$this->first_name} {$this->last_name}";
4    }
5  
6
7      $agents = User::whereId($agent->id)->get()->pluck('full_name', 'id');
8
9
10      $agents = json_decode(json_encode($agents), true);