laravel dynamic attributes
class User extends Eloquent {
public function getFullNameAttribute()
{
return $this->first_name.' '.$this->last_name;
}
}
3.73
10
$user = User::find(1);
$user->full_name;
Thank you!
10
0
Are there any code examples left?
New code examples in category PHP