protected function beforeDelete() { if (parent::beforeDelete()) { foreach ($this->commissioningbodyassigments as $cba) { $cba->delete(); } return true; } }