Convert deprecated $dates property to $casts

This commit is contained in:
Laravel Shift 2021-02-14 19:46:05 +00:00
parent 3b2d58b77f
commit 40ead10cd8
5 changed files with 8 additions and 7 deletions

View file

@ -59,7 +59,7 @@ class Activity extends Model
use SoftDeletes;
public $timestamps = false;
protected $dates = ['created_at'];
protected $fillable = ['created_at', 'user_id', 'activity_type', 'resource_type', 'resource_id'];
protected $appends = ['url', 'thumbnail_url', 'human_friendly_resource_type'];
protected $casts = [

View file

@ -52,7 +52,7 @@ use Illuminate\Support\Facades\Request;
class ResourceLogItem extends Model
{
public $timestamps = false;
protected $dates = ['created_at'];
const VIEW = 1;
const DOWNLOAD = 2;

View file

@ -154,11 +154,10 @@ class Track extends Model implements Searchable, Commentable, Favouritable
protected $elasticsearchType = 'track';
protected $dates = [
'published_at', 'released_at',
];
protected $hidden = ['original_tags', 'metadata'];
protected $casts = [
'published_at' => 'datetime',
'released_at' => 'datetime',
'id' => 'integer',
'user_id' => 'integer',
'license_id' => 'integer',

View file

@ -67,8 +67,9 @@ class TrackFile extends Model
const STATUS_PROCESSING_PENDING = 3;
protected $appends = ['is_expired'];
protected $dates = ['expires_at'];
protected $casts = [
'expires_at' => 'datetime',
'id' => 'integer',
'track_id' => 'integer',
'is_master' => 'boolean',

View file

@ -110,6 +110,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $elasticsearchType = 'user';
protected $casts = [
'disabled_at' => 'datetime',
'id' => 'integer',
'sync_names' => 'boolean',
'uses_gravatar' => 'boolean',
@ -120,7 +121,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
'is_archived' => 'boolean',
'redirect_to' => 'integer',
];
protected $dates = ['created_at', 'updated_at', 'disabled_at'];
protected $hidden = ['disabled_at', 'remember_token'];
public function scopeUserDetails($query)