studio24/accessible-forms
A Laravel package for building accessible forms, with Blade components and helpers that add proper labels, error messages, and ARIA attributes to help your forms meet WCAG accessibility standards.
composer require studio24/accessible-forms. The package is framework-agnostic, so in Laravel you wire it into a controller/form request and render the output from Blade rather than expecting a full Laravel form builder.Form/field API, the bundled templates (labels, fieldsets, error summary), and any config file for default CSS classes or template paths. If you need to override markup, publish/copy the templates into resources/views/vendor/accessible-forms (or the package’s documented override path).old() on validation failure, pass Laravel’s MessageBag into the form, and render it in Blade.Vite::cspNonce() or your CSP package) and pass it at render time.App\Forms\ContactForm (or similar) so controllers stay thin. A typical flow is: instantiate the form, bind request data, run $request->validate($form->rules()), then $form->setErrors($validator->errors()) and re-render on failure.aria-describedby, aria-invalid, and error text so accessibility attributes stay consistent.items.0.name). For checkboxes/radios, ensure the form repopulates checked state from old(); for selects, ensure the selected option is restored. Use Laravel’s required, email, etc. as the source of truth and let the package handle presentation.{!! $form->render(['nonce' => $nonce]) !!} (check the README for the exact signature). If you render form partials via AJAX, include the nonce on those responses too, and keep it per-request—never cache a rendered form containing a nonce.@csrf in the surrounding Blade form or confirm the package emits a CSRF hidden input. For PUT/PATCH/DELETE, add @method(...) outside the package output unless the package supports it directly.Content-Security-Policy header (or vice versa) still fails. With spatie/laravel-csp or Laravel’s Vite nonce, read the same value in both places.{!! !!}. Verify that user-supplied values (names, messages) are escaped by the package; if you inject custom HTML into labels/hints, escape it yourself.^0.3 and read the changelog before minor upgrades; watch for renamed render options or template paths.nonce attribute on the <script> tag, check the browser console for “Refused to execute inline script”, and confirm the Content-Security-Policy response header contains the same nonce. If the nonce is missing, check that the render call actually received it (many integrations silently drop unknown options).old() keys that differ from field names (e.g. nested array fields) when repopulating.How can I help you explore Laravel packages today?