Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Forms Laravel Package

nette/forms

Robust PHP form library from Nette for building and validating HTML forms. Provides reusable controls, CSRF protection, server-side validation with clear error handling, rendering helpers, and strong integration with Nette applications for secure, maintainable form workflows.

View on GitHub
Deep Wiki
Context7

📝 Generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.

Frequently asked questions about Forms
Can I use nette/forms in Laravel without Nette Framework?
Yes, nette/forms is a standalone library. Install via Composer (`composer require nette/forms`) and use it alongside Laravel. It has no framework dependencies beyond PHP 8.1+, making it fully compatible with Laravel’s ecosystem.
How does nette/forms handle CSRF protection in Laravel?
nette/forms includes built-in CSRF protection via `Form::addProtection()`. In Laravel, you may need to disable the default CSRF middleware for routes using nette/forms or configure middleware ordering to avoid token conflicts.
Will nette/forms work with Laravel’s Blade templating?
nette/forms relies on Latte by default, but you can create a custom renderer for Blade. The library provides `DefaultFormRenderer`, which you can extend to output Blade-compatible HTML. This requires ~2–4 hours of development time.
Can I replace Laravel’s Validator facade entirely with nette/forms?
Yes, nette/forms offers a more declarative, object-oriented validation API. For complex forms (e.g., multi-step or dynamic fields), it’s a robust alternative. Use it alongside Laravel’s `FormRequest` for hybrid validation workflows.
Does nette/forms support client-side validation like Laravel’s Livewire?
Yes, nette/forms includes `netteForms.js` for client-side validation. It syncs with server-side rules via `data-nette-rules` attributes (e.g., `required|email`), reducing duplication. Works seamlessly with Vue, React, or Alpine.js.
What Laravel versions does nette/forms support?
nette/forms requires PHP 8.1+, which aligns with Laravel 9+. For older Laravel versions (8.x), you may need polyfills for PHP 8.1+ features like enums or strict types. Test thoroughly in your environment.
How do I integrate nette/forms with Laravel’s Eloquent models?
nette/forms doesn’t natively bind to Eloquent, but you can hydrate models using `Container::getValues($model)`. For validation, define rules in the form and manually map validated data to your model after submission.
Are there performance concerns using nette/forms in high-traffic Laravel apps?
nette/forms is optimized for Nette’s DI, but Laravel’s service container may introduce minor overhead. Benchmark critical paths (e.g., form submission). For high traffic (10K+ submissions/day), cache validation rules or use Laravel’s queue system for processing.
How do I test nette/forms in Laravel with PHPUnit?
Test forms by creating a `Form` instance in your PHPUnit tests and simulating submissions. Use `Form::setValues()` to populate data and `Form::isValid()` to verify validation. Mock dependencies like custom validators or services as needed.
What are the alternatives to nette/forms for Laravel form handling?
Laravel’s built-in `Validator` facade is lightweight but procedural. For OOP alternatives, consider `symfony/form` (more feature-rich but heavier) or `illuminate/validation` (native but less flexible). nette/forms strikes a balance with a clean API and client-server sync.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata