Infolist Custom ViewEntry added form field validation.

On a custom Infolist page, I added a new custom ViewEntry with a blade file, needs to validate all fields before performing Infolist submit action.

ViewEntry::make('acceptConsent')->label('')->view('user-consent::infolists.components.consent-option-checkbox'),

Action::make('saveConsents') ->icon('heroicon-o-check-circle') ->color('success') ->before(function (Action $action) { $this->validateConsents($action); }) ->action(function (array $data) { $this->acceptConsent();}), }
Was this page helpful?