user()?->hasRole('PPM') === true; } /** * @return array */ public function rules(): array { return [ 'approved_position_code' => ['required', Rule::in(['KTM', 'KP', 'KPDP', 'PAPM'])], 'saluran_mengundi_id' => [ Rule::requiredIf(fn (): bool => $this->input('approved_position_code') === 'KTM'), 'nullable', 'integer', ], 'ktm_assignment_id' => [ Rule::requiredIf(fn (): bool => in_array($this->input('approved_position_code'), ['KP', 'KPDP'], true)), 'nullable', 'integer', ], 'note' => ['nullable', 'string', 'max:1000'], ]; } }