This website collects cookies to deliver better user experience
public function getFirstNameAttribute($value) { return ucfirst($value); }
public function setFirstNameAttribute($value) { $this->attribute['first_name'] = strtolower($value); }
public function firtName() :Attribute { return new Attribute ( get: fn($value, $attributes) => $attribute['first_name'], set: fn($value) => 'first_name' => $value ); }
public function fullName() :Attribute { return new Attribute( get: fn($value, $attributes) => $attributes['first_name'] . ' ' . $attributes['last_name'], set: function($value) { [$firstName, $lastName] = explode(" ", $value); return [ 'first_name' => $firstName, 'last_name' => $lastName ]; } ); } public function password() :Attribute { return new Attribute( get: null, set: fn($value) => bcrypt($value) ); }
30
0