Changeset View
Changeset View
Standalone View
Standalone View
src/app/Wallet.php
Show First 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | class Wallet extends Model | ||||
public function removeController(User $user) | public function removeController(User $user) | ||||
{ | { | ||||
if ($this->controllers->contains($user)) { | if ($this->controllers->contains($user)) { | ||||
$this->controllers()->detach($user); | $this->controllers()->detach($user); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Any (additional) properties of this wallet. | |||||
* | |||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | |||||
*/ | |||||
public function settings() | |||||
{ | |||||
return $this->hasMany('App\WalletSetting'); | |||||
} | |||||
/** | |||||
* Retrieve the transactions against this wallet. | * Retrieve the transactions against this wallet. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Builder Query builder | * @return \Illuminate\Database\Eloquent\Builder Query builder | ||||
*/ | */ | ||||
public function transactions() | public function transactions() | ||||
{ | { | ||||
return \App\Transaction::where( | return \App\Transaction::where( | ||||
[ | [ | ||||
'object_id' => $this->id, | 'object_id' => $this->id, | ||||
'object_type' => \App\Wallet::class | 'object_type' => \App\Wallet::class | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
} | } |