Basic user management
This commit is contained in:
@@ -24,7 +24,7 @@ class Tenant extends CommonModel
|
||||
|
||||
protected $fillable = [
|
||||
'slug',
|
||||
'local_group_name',
|
||||
'name',
|
||||
'email',
|
||||
'url',
|
||||
'account_iban',
|
||||
|
||||
@@ -5,6 +5,34 @@ namespace App\Models;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
/**
|
||||
* @property string $username
|
||||
* @property string $local_group
|
||||
* @property string $firstname
|
||||
* @property string $nickname
|
||||
* @property string $lastname
|
||||
* @property string $membership_id
|
||||
* @property string $address_1
|
||||
* @property string $address_2
|
||||
* @property string $postcode
|
||||
* @property string $city
|
||||
* @property string $email
|
||||
* @property string $phone
|
||||
* @property string $birthday
|
||||
* @property string $medications
|
||||
* @property string $allergies
|
||||
* @property string $intolerances
|
||||
* @property string $eating_habits
|
||||
* @property string $swimming_permission
|
||||
* @property string $first_aid_permission
|
||||
* @property string $bank_account_iban
|
||||
* @property string $password
|
||||
* @property boolean $active
|
||||
* @property string $user_role_main
|
||||
* @property string $user_role_local_group
|
||||
* @property string $activation_token
|
||||
* @property string $activation_token_expires_at
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
@@ -15,13 +43,15 @@ class User extends Authenticatable
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'user_role',
|
||||
'user_role_main',
|
||||
'user_role_local_group',
|
||||
'activation_token',
|
||||
'activation_token_expires_at',
|
||||
'username',
|
||||
'local_group',
|
||||
'firstname',
|
||||
'nickname',
|
||||
'lastname',
|
||||
'local_group_id',
|
||||
'membership_id',
|
||||
'address_1',
|
||||
'address_2',
|
||||
@@ -58,8 +88,19 @@ class User extends Authenticatable
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function getFullname() : string {
|
||||
return sprintf('%1$1s %2$s %3$s',
|
||||
$this->firstname,
|
||||
$this->nickname !== '' ? '(' . $this->nickname . ')' : '',
|
||||
$this->lastname
|
||||
);
|
||||
}
|
||||
|
||||
public function getNicename() : string {
|
||||
return $this->nickname !== '' ? $this->nickname : $this->firstname;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user