@@ -59,9 +59,8 @@ class CreateGameLeaderboardsTable extends Migration
5959
6060When creating a model, the following logic will be automated for you:
6161
62- * [ Attribute Casting] ( https://laravel.com/docs/eloquent-mutators#attribute-casting ) their appropriate type (strings, integers, floats...).
63- * [ Serialization hiding] ( https://laravel.com/docs/eloquent-serialization#hiding-attributes-from-json ) for sensible data.
64- * [ Mutating dates columns] ( https://laravel.com/docs/eloquent-mutators#date-mutators ) as ` date ` and ` datetime ` .
62+ * [ Attribute Casting] ( https://laravel.com/docs/eloquent-mutators#attribute-casting ) their appropriate type (dates, strings, integers, floats...).
63+ * [ Serialization hiding] ( https://laravel.com/docs/eloquent-serialization#hiding-attributes-from-json )
6564* [ Relationships] ( https://laravel.com/docs/eloquent-relationships ) with methods and pivot tables, if necessary.
6665* PHPDoc mixin for Eloquent Builder, ` create ` and ` make ` methods among others (` find ` , ` firstOrNew ` , etc.)
6766* PHPDoc blocks for model properties and relations.
@@ -289,22 +288,20 @@ class Podcast extends Model
289288 * @var bool
290289 */
291290 public $incrementing = false;
292-
291+
293292 /**
294- * The number of models-properties to return for pagination .
293+ * The attributes that should be cast .
295294 *
296- * @var int
295+ * @var array
297296 */
298- protected $perPage = 20 ;
297+ protected $casts = ['published_at' => 'datetime'] ;
299298
300299 /**
301- * The attributes that should be mutated to dates .
300+ * The number of models-properties to return for pagination .
302301 *
303- * @var array
302+ * @var int
304303 */
305- protected $dates = [
306- ' published_at' ,
307- ];
304+ protected $perPage = 20;
308305
309306 /**
310307 * The attributes that are mass assignable.
0 commit comments