classMapper->getClassMapping('organisation')::where('id', $owner_id)->first(); if (!$organisation) { return false; } // If specified, recored the approver. This assumes the model has an approver_id field which it may not... if ($args['approver_id']) { $model->approver_id = $args['approver_id']; } if ($args['approved']) { // Mark the organisation as approved $organisation->flag_approved = 1; $organisation->save(); } else { // Soft delete the organisation $organisation->delete(false); } return true; } }