Basic user management

This commit is contained in:
2026-02-05 00:46:22 +01:00
parent e280fcfba8
commit 11108bdfcc
55 changed files with 1524 additions and 54 deletions

View File

@@ -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;
}
}