Changeset View
Changeset View
Standalone View
Standalone View
src/app/Payment.php
Show All 16 Lines | |||||
{ | { | ||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
protected $casts = [ | protected $casts = [ | ||||
'amount' => 'integer' | 'amount' => 'integer' | ||||
]; | ]; | ||||
protected $fillable = [ | |||||
'id', | |||||
'wallet_id', | |||||
'amount', | |||||
'description', | |||||
'provider', | |||||
'status', | |||||
'type', | |||||
]; | |||||
/** | /** | ||||
* 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( | return $this->belongsTo( | ||||
'\App\Wallet', | '\App\Wallet', | ||||
'wallet_id', /* local */ | 'wallet_id', /* local */ | ||||
'id' /* remote */ | 'id' /* remote */ | ||||
); | ); | ||||
} | } | ||||
} | } |