Skip to content

Commit

Permalink
use $casts instead of $dates
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Feb 17, 2023
1 parent b85259e commit 3e5e602
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ class Post extends Model
*/
protected $perPage = 10;

/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = [
'published_at',
];

/**
* The accessors to append to the model's array form.
*
Expand All @@ -80,6 +71,7 @@ class Post extends Model
* @var array
*/
protected $casts = [
'published_at' => 'datetime:Y-m-d',
'meta' => 'array',
];

Expand Down

0 comments on commit 3e5e602

Please sign in to comment.