I need to populate a blade format tag.
I\'m aware of the Model::pluck(\'column1\', \'column2\')
method to populate a select tag.
Best solution is to create accessor function into your model, let's assume if you want to get full name then you can do like this.
public function getFullNameAttribute()
{
return $this->first_name . ' ' . $this->last_name;
}
and you can easily get full name.
$users = User::where('id', 1)->get()->pluck('full_name', 'id');
Eloquent will call getFullNameAttribute
function and get concatenated value.