install
This commit is contained in:
43
app/Modules/UserAdjustments/Traits/UserAdjustments.php
Normal file
43
app/Modules/UserAdjustments/Traits/UserAdjustments.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\UserAdjustments\Traits;
|
||||
|
||||
/**
|
||||
* @property string $username [unique]
|
||||
* @property string|null $first_name
|
||||
* @property string|null $last_name
|
||||
* @property string|null $phone
|
||||
* @property \Illuminate\Support\Facades\Date|null $phone_verified_at
|
||||
* @property string $locale [default: tk]
|
||||
* @property bool $password_must_be_changed [default: false]
|
||||
* @property bool $must_fill_profile [default: false]
|
||||
* @property null|array $options
|
||||
*/
|
||||
trait UserAdjustments
|
||||
{
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'phone_verified_at' => 'datetime',
|
||||
'password_must_be_changed' => 'bool',
|
||||
'must_fill_profile' => 'bool',
|
||||
'options' => 'array',
|
||||
'custom_fields' => 'array',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get option from options
|
||||
*/
|
||||
public function getOption(string $option): null|int|string
|
||||
{
|
||||
return $this->options && array_key_exists($option, $this->options) ? $this->options[$option] : '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user