*/ protected $fillable = [ 'active', 'inactive', 'old_accounts', 'new_accounts', 'total_accounts', 'total_opt_in', ]; /** * The attributes that should be cast to native types. * * @var array */ public $casts = [ 'created_at' => 'date', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::creating(function (self $model) { if (!$model->created_at) { $model->created_at = now(); } }); } // * RELATIONS /** * Brand belongs to relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function brand(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Brand::class); } }