Merge branch '1.0-develop' into develop

This commit is contained in:
Matthew Penner 2023-02-23 12:36:22 -07:00
commit 18f6611a2d
No known key found for this signature in database
60 changed files with 181 additions and 152 deletions

View file

@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
* @property array|null $allowed_ips
* @property string|null $memo
* @property \Illuminate\Support\Carbon|null $last_used_at
* @property \Illuminate\Support\Carbon|null $expires_at
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property int $r_servers
@ -97,6 +98,10 @@ class ApiKey extends Model
protected $casts = [
'allowed_ips' => 'array',
'user_id' => 'int',
'last_used_at' => 'datetime',
'expires_at' => 'datetime',
self::CREATED_AT => 'datetime',
self::UPDATED_AT => 'datetime',
'r_' . AdminAcl::RESOURCE_USERS => 'int',
'r_' . AdminAcl::RESOURCE_ALLOCATIONS => 'int',
'r_' . AdminAcl::RESOURCE_DATABASE_HOSTS => 'int',
@ -117,6 +122,7 @@ class ApiKey extends Model
'allowed_ips',
'memo',
'last_used_at',
'expires_at',
];
/**
@ -137,6 +143,7 @@ class ApiKey extends Model
'allowed_ips' => 'nullable|array',
'allowed_ips.*' => 'string',
'last_used_at' => 'nullable|date',
'expires_at' => 'nullable|date',
'r_' . AdminAcl::RESOURCE_USERS => 'integer|min:0|max:3',
'r_' . AdminAcl::RESOURCE_ALLOCATIONS => 'integer|min:0|max:3',
'r_' . AdminAcl::RESOURCE_DATABASE_HOSTS => 'integer|min:0|max:3',
@ -148,12 +155,6 @@ class ApiKey extends Model
'r_' . AdminAcl::RESOURCE_SERVERS => 'integer|min:0|max:3',
];
protected $dates = [
self::CREATED_AT,
self::UPDATED_AT,
'last_used_at',
];
/**
* Returns the user this token is assigned to.
*/

View file

@ -42,10 +42,7 @@ class Backup extends Model
'is_locked' => 'bool',
'ignored_files' => 'array',
'bytes' => 'int',
];
protected $dates = [
'completed_at',
'completed_at' => 'datetime',
];
protected $attributes = [

View file

@ -71,14 +71,8 @@ class Schedule extends Model
'is_active' => 'boolean',
'is_processing' => 'boolean',
'only_when_online' => 'boolean',
];
/**
* Columns to mutate to a date.
*/
protected $dates = [
'last_run_at',
'next_run_at',
'last_run_at' => 'datetime',
'next_run_at' => 'datetime',
];
protected $attributes = [

View file

@ -140,11 +140,6 @@ class Server extends Model
*/
protected $with = ['allocation'];
/**
* The attributes that should be mutated to dates.
*/
protected $dates = [self::CREATED_AT, self::UPDATED_AT, 'deleted_at', 'installed_at'];
/**
* Fields that are not mass assignable.
*/
@ -194,6 +189,10 @@ class Server extends Model
'database_limit' => 'integer',
'allocation_limit' => 'integer',
'backup_limit' => 'integer',
self::CREATED_AT => 'datetime',
self::UPDATED_AT => 'datetime',
'deleted_at' => 'datetime',
'installed_at' => 'datetime',
];
/**

View file

@ -23,10 +23,8 @@ class TaskLog extends Model
'id' => 'integer',
'task_id' => 'integer',
'run_status' => 'integer',
'run_time' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/**
* The attributes that should be mutated to dates.
*/
protected $dates = ['run_time', 'created_at', 'updated_at'];
}

View file

@ -138,10 +138,9 @@ class User extends Model implements
'root_admin' => 'boolean',
'use_totp' => 'boolean',
'gravatar' => 'boolean',
'totp_authenticated_at' => 'datetime',
];
protected $dates = ['totp_authenticated_at'];
/**
* The attributes excluded from the model's JSON form.
*/