diff --git a/src/Models/OAuth.php b/src/Models/OAuth.php index 62de480e..4c3a329a 100644 --- a/src/Models/OAuth.php +++ b/src/Models/OAuth.php @@ -30,6 +30,13 @@ class OAuth extends BaseModel public $table = 'oauth'; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'access_token' => null, + 'refresh_token' => null, + 'expires_at' => null, + ]; + /** @var bool Enable timestamps */ public $timestamps = true; // phpcs:ignore diff --git a/src/Models/Question.php b/src/Models/Question.php index cab51ae8..598fe912 100644 --- a/src/Models/Question.php +++ b/src/Models/Question.php @@ -36,6 +36,13 @@ class Question extends BaseModel /** @var bool Enable timestamps */ public $timestamps = true; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'answer' => null, + 'answerer_id' => null, + 'answered_at' => null, + ]; + /** @var array */ protected $dates = [ // phpcs:ignore 'answered_at', diff --git a/src/Models/Room.php b/src/Models/Room.php index 42c6d9a9..b4262570 100644 --- a/src/Models/Room.php +++ b/src/Models/Room.php @@ -39,6 +39,13 @@ class Room extends BaseModel /** @var bool Enable timestamps */ public $timestamps = true; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'map_url' => null, + 'description' => null, + 'dect' => null, + ]; + /** @var array */ protected $fillable = [ // phpcs:ignore 'name', diff --git a/src/Models/Shifts/NeededAngelType.php b/src/Models/Shifts/NeededAngelType.php index c3223b2e..b7a40cdc 100644 --- a/src/Models/Shifts/NeededAngelType.php +++ b/src/Models/Shifts/NeededAngelType.php @@ -32,6 +32,12 @@ class NeededAngelType extends BaseModel { use HasFactory; + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'room_id' => null, + 'shift_id' => null, + ]; + /** @var array */ protected $fillable = [ // phpcs:ignore 'room_id', @@ -40,12 +46,6 @@ class NeededAngelType extends BaseModel 'count', ]; - /** @var array default attributes */ - protected $attributes = [ // phpcs:ignore - 'room_id' => null, - 'shift_id' => null, - ]; - public function room(): BelongsTo { return $this->belongsTo(Room::class); diff --git a/src/Models/Shifts/Shift.php b/src/Models/Shifts/Shift.php index ceabee40..95f831e1 100644 --- a/src/Models/Shifts/Shift.php +++ b/src/Models/Shifts/Shift.php @@ -56,6 +56,14 @@ class Shift extends BaseModel { use HasFactory; + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'description' => '', + 'url' => '', + 'transaction_id' => null, + 'updated_by' => null, + ]; + /** @var bool enable timestamps */ public $timestamps = true; // phpcs:ignore diff --git a/src/Models/Shifts/ShiftEntry.php b/src/Models/Shifts/ShiftEntry.php index 632f5649..1ba40148 100644 --- a/src/Models/Shifts/ShiftEntry.php +++ b/src/Models/Shifts/ShiftEntry.php @@ -34,6 +34,13 @@ class ShiftEntry extends BaseModel use HasFactory; use UsesUserModel; + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'user_comment' => '', + 'freeloaded' => false, + 'freeloaded_comment' => '', + ]; + /** @var array */ protected $fillable = [ // phpcs:ignore 'shift_id', @@ -44,13 +51,6 @@ class ShiftEntry extends BaseModel 'freeloaded_comment', ]; - /** @var array default attributes */ - protected $attributes = [ // phpcs:ignore - 'user_comment' => '', - 'freeloaded' => false, - 'freeloaded_comment' => '', - ]; - /** @var array */ protected $casts = [ // phpcs:ignore 'freeloaded' => 'bool', diff --git a/src/Models/User/Contact.php b/src/Models/User/Contact.php index b4e74f89..043e29c2 100644 --- a/src/Models/User/Contact.php +++ b/src/Models/User/Contact.php @@ -20,6 +20,13 @@ class Contact extends HasUserModel { use HasFactory; + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'dect' => null, + 'mobile' => null, + 'email' => null, + ]; + /** @var string The table associated with the model */ protected $table = 'users_contact'; // phpcs:ignore diff --git a/src/Models/User/License.php b/src/Models/User/License.php index 383f9651..a25102bb 100644 --- a/src/Models/User/License.php +++ b/src/Models/User/License.php @@ -33,7 +33,7 @@ class License extends HasUserModel /** @var string The table associated with the model */ protected $table = 'users_licenses'; // phpcs:ignore - /** @var array Default attributes */ + /** @var array Default attributes */ protected $attributes = [ // phpcs:ignore 'has_car' => false, 'drive_forklift' => false, diff --git a/src/Models/User/PersonalData.php b/src/Models/User/PersonalData.php index 5bc01793..0007ae14 100644 --- a/src/Models/User/PersonalData.php +++ b/src/Models/User/PersonalData.php @@ -30,6 +30,16 @@ class PersonalData extends HasUserModel /** @var string The table associated with the model */ protected $table = 'users_personal_data'; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'first_name' => null, + 'last_name' => null, + 'pronoun' => null, + 'shirt_size' => null, + 'planned_arrival_date' => null, + 'planned_departure_date' => null, + ]; + /** @var array The attributes that should be mutated to dates */ protected $dates = [ // phpcs:ignore 'planned_arrival_date', diff --git a/src/Models/User/State.php b/src/Models/User/State.php index 6661dd6f..145ca17d 100644 --- a/src/Models/User/State.php +++ b/src/Models/User/State.php @@ -30,9 +30,10 @@ class State extends HasUserModel /** @var string The table associated with the model */ protected $table = 'users_state'; // phpcs:ignore - /** @var array Default attributes */ + /** @var array Default attributes */ protected $attributes = [ // phpcs:ignore 'arrived' => false, + 'arrival_date' => null, 'active' => false, 'force_active' => false, 'got_shirt' => false, diff --git a/src/Models/User/User.php b/src/Models/User/User.php index 5ee705e0..25c21e5b 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -78,6 +78,11 @@ class User extends BaseModel /** @var bool enable timestamps */ public $timestamps = true; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'last_login_at' => null, + ]; + /** * The attributes that are mass assignable. * diff --git a/src/Models/UserAngelType.php b/src/Models/UserAngelType.php index 83fcbecd..0a37b918 100644 --- a/src/Models/UserAngelType.php +++ b/src/Models/UserAngelType.php @@ -39,6 +39,12 @@ class UserAngelType extends Pivot /** @var bool Disable timestamps */ public $timestamps = false; // phpcs:ignore + /** @var array default attributes */ + protected $attributes = [ // phpcs:ignore + 'confirm_user_id' => null, + 'supporter' => false, + ]; + /** @var array */ protected $fillable = [ // phpcs:ignore 'user_id',