add more fillable fields on models

This commit is contained in:
Pig Fang 2020-06-06 15:48:43 +08:00
parent ab264604e0
commit b9a40af92d
4 changed files with 15 additions and 2 deletions

View File

@ -29,7 +29,9 @@ class Player extends Model
public const UPDATED_AT = 'last_modified';
public $primaryKey = 'pid';
protected $fillable = ['uid', 'name', 'last_modified'];
protected $fillable = [
'uid', 'name', 'tid_skin', 'tid_cape', 'last_modified',
];
protected $casts = [
'pid' => 'integer',

View File

@ -29,6 +29,10 @@ class Report extends Model
public const RESOLVED = 1;
public const REJECTED = 2;
protected $fillable = [
'uploader', 'reporter', 'reason', 'status',
];
protected $casts = [
'tid' => 'integer',
'uploader' => 'integer',

View File

@ -27,6 +27,10 @@ class Texture extends Model
public const CREATED_AT = 'upload_at';
public const UPDATED_AT = null;
protected $fillable = [
'name', 'type', 'uploader', 'public', 'likes',
];
protected $casts = [
'tid' => 'integer',
'size' => 'integer',

View File

@ -40,7 +40,10 @@ class User extends Authenticatable implements JWTSubject
protected $primaryKey = 'uid';
public $timestamps = false;
protected $fillable = ['email', 'nickname', 'permission'];
protected $fillable = [
'email', 'nickname', 'avatar', 'score', 'permission', 'last_sign_at',
];
protected $casts = [
'uid' => 'integer',