Changeset View
Changeset View
Standalone View
Standalone View
src/app/Observers/WalletObserver.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | public function deleting(Wallet $wallet) | ||||
if ($wallet->owner->wallets()->count() <= 1) { | if ($wallet->owner->wallets()->count() <= 1) { | ||||
return false; | return false; | ||||
} | } | ||||
// can't remove a wallet that has billable entitlements attached. | // can't remove a wallet that has billable entitlements attached. | ||||
if ($wallet->entitlements()->count() > 0) { | if ($wallet->entitlements()->count() > 0) { | ||||
return false; | return false; | ||||
} | } | ||||
/* | |||||
// can't remove a wallet that has payments attached. | |||||
if ($wallet->payments()->count() > 0) { | |||||
return false; | |||||
vanmeeuwen: Is this because of the referential integrity by foreign key? | |||||
} | |||||
*/ | |||||
} | } | ||||
} | } |
Is this because of the referential integrity by foreign key?