Changeset View
Changeset View
Standalone View
Standalone View
src/app/Payment.php
Show All 14 Lines | |||||
* @property string $currency Currency of this payment | * @property string $currency Currency of this payment | ||||
* @property int $currency_amount Amount of money in cents of $currency | * @property int $currency_amount Amount of money in cents of $currency | ||||
*/ | */ | ||||
class Payment extends Model | class Payment extends Model | ||||
{ | { | ||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
/** @var array<string, string> The attributes that should be cast */ | |||||
protected $casts = [ | protected $casts = [ | ||||
'amount' => 'integer' | 'amount' => 'integer' | ||||
]; | ]; | ||||
/** @var array<int,string> The attributes that are mass assignable */ | |||||
protected $fillable = [ | protected $fillable = [ | ||||
'id', | 'id', | ||||
'wallet_id', | 'wallet_id', | ||||
'amount', | 'amount', | ||||
'description', | 'description', | ||||
'provider', | 'provider', | ||||
'status', | 'status', | ||||
'type', | 'type', | ||||
Show All 12 Lines | class Payment extends Model | ||||
/** | /** | ||||
* The wallet to which this payment belongs. | * The wallet to which this payment belongs. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function wallet() | public function wallet() | ||||
{ | { | ||||
return $this->belongsTo('\App\Wallet', 'wallet_id', 'id'); | return $this->belongsTo(Wallet::class, 'wallet_id', 'id'); | ||||
} | } | ||||
} | } |