Skip to content

PHP code snippet – How to pluck fullname database laravel?

    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);
See also  Python code snippet - How to use rnage?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.