I am using laravel and I want to add dynamic custom attribute in controller
I know there is a way like this
public function getFullNameAttribute()
{
return $this->first_name.' '.$this->last_name;
}
now you can get full name as:
$user = User::find(1);
$user->full_name;
but it is in Model I want to declare custom att in controller is it possible?
getFullNameWithExtra($extra) {...}