moktar
1 month ago
138
2
Laravel

any idea how i can refactor this ? what is best practice ?

Posted 1 month ago by moktar
if ($event->isHoliday()) {
            if ($status === $event::PENDING && $event->approved_by == null) {
                $event->resetEmployeeBalance(null);
            } elseif ($status === $event::REJECTED) {
                $event->resetEmployeeBalance('keep_balance');
            } elseif ($status === $event::ACCEPTED && !$event->approved_by == null) {
                $event->resetEmployeeBalance('take_balance');
            }
        }

Please sign in or create an account to participate in this conversation.