profile update

This commit is contained in:
2025-03-23 23:46:02 +05:00
parent d25227867c
commit 785e48d175
5 changed files with 79 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ use Spatie\Permission\Traits\HasRoles;
* @property null|\Illuminate\Support\Carbon $phone_verified_at
* @property string $password
* @property string $locale
* @property null|array $options
* @property bool $active
* @property string $remember_token
* @property \Illuminate\Support\Carbon $created_at
@@ -71,6 +72,7 @@ class User extends Authenticatable
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'options' => 'array',
];
/**
@@ -210,4 +212,12 @@ class User extends Authenticatable
{
return sprintf('/resources/users/%s', $this->id);
}
/**
* Get option from options
*/
public function getOption(string $option): null|int|string
{
return $this->options && array_key_exists($option, $this->options) ? $this->options[$option] : '';
}
}