*/ protected $fillable = [ 'calls', 'date', 'url_key', 'url', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'date' => 'date', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::creating(function (self $model) { $model->calls = 1; $model->date = now(); }); } }