Laravel Ajouter un attribut au modèle
$user = User::find(1);
// add occupation to user instance
$user->setAttribute('occupation', 'Web Developer');
Yingfufu
$user = User::find(1);
// add occupation to user instance
$user->setAttribute('occupation', 'Web Developer');
public function getAvailabilityAttribute()
{
return $this->calculateAvailability();
}