Changeset View
Changeset View
Standalone View
Standalone View
src/app/Discount.php
Show All 20 Lines | class Discount extends Model | ||||
use BelongsToTenantTrait; | use BelongsToTenantTrait; | ||||
use HasTranslations; | use HasTranslations; | ||||
use UuidStrKeyTrait; | use UuidStrKeyTrait; | ||||
protected $casts = [ | protected $casts = [ | ||||
'discount' => 'integer', | 'discount' => 'integer', | ||||
]; | ]; | ||||
protected $fillable = [ | /** @var array<int, string> The attributes that are mass assignable */ | ||||
'active', | protected $fillable = ['active', 'code', 'description', 'discount']; | ||||
'code', | |||||
'description', | /** @var array<int, string> Translatable properties */ | ||||
'discount', | public $translatable = ['description']; | ||||
]; | |||||
/** @var array Translatable properties */ | |||||
public $translatable = [ | |||||
'description', | |||||
]; | |||||
/** | /** | ||||
* Discount value mutator | * Discount value mutator | ||||
* | * | ||||
* @throws \Exception | * @throws \Exception | ||||
*/ | */ | ||||
public function setDiscountAttribute($discount) | public function setDiscountAttribute($discount) | ||||
{ | { | ||||
Show All 14 Lines | class Discount extends Model | ||||
/** | /** | ||||
* List of wallets with this discount assigned. | * List of wallets with this discount assigned. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | * @return \Illuminate\Database\Eloquent\Relations\HasMany | ||||
*/ | */ | ||||
public function wallets() | public function wallets() | ||||
{ | { | ||||
return $this->hasMany('App\Wallet'); | return $this->hasMany(Wallet::class); | ||||
} | } | ||||
} | } |