'date' ]; /** * The attributes that are mass assignable. * * @var string[] */ protected $fillable = [ 'active', 'inactive', 'old_accounts', 'new_accounts', 'total_accounts', 'total_opt_in' ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { static::creating(function (BrandStat $stat) { if (!$stat->created_at) { $stat->created_at = Carbon::now(); } }); } // * RELATIONS /** * Brand hasMany relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function brand() { return $this->belongsTo(Brand::class); } }