*/ protected $fillable = [ 'label', 'type', 'balance', 'brand_id' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'type' => AccountTypeEnum::class ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::deleting(function () { throw new \Error('Action impossible'); }); } // * RELATIONSHIPS /** * BelongsTo Brand relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function brand(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Brand::class); } /** * HasOne Account relation * * @return \Illuminate\Database\Eloquent\Relations\HasOne */ public function creditlogs(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->HasOne(CreditLog::class, 'credit_account_id'); } }