- How do I install maxlab/stacker in a Laravel application?
- Install the package with Composer by running composer require maxlab/stacker. Laravel package auto-discovery should register the service provider; if your app disables discovery, add the provider manually in config/app.php. Then publish any package configuration or Blade views if the README instructs you to, and define your first form in PHP.
- Which Laravel versions are supported by maxlab/stacker?
- The supported Laravel and PHP versions are defined in the package's composer.json constraints. Check those constraints on Packagist before installing, especially if you are on a newer Laravel release. If you need an older or newer framework version, verify compatibility in a staging branch before rolling it out.
- How do I define a dynamic form with Stacker?
- Use Stacker's fluent API to create a form, then attach groups and field stacks that describe each input. Field definitions live in PHP, so you can reuse the same stack across multiple forms. After defining the form, render it in Blade and let Stacker handle validation and submission storage.
- Can I create custom field types in maxlab/stacker?
- Yes. Stacker is built around reusable and custom field types, so you can define a field class for your own input or display needs. A custom field typically handles its own rendering and validation rules while fitting into the same form and field-stack API. Keep custom fields small and test them independently.
- How does validation work with Stacker forms?
- Stacker integrates with Laravel's built-in validation so form rules stay aligned with framework conventions. You define rules for the form or its fields, then validate the incoming request before persisting a submission. Because it uses Laravel validation, standard rules, error messages, and request validation patterns apply.
- How do I render a Stacker form in Blade?
- Stacker provides Blade rendering for forms and their fields, so you can output a defined form without hand-writing every input. Use the package's Blade helpers or views as documented in the README, and pass the form instance to the template. If you need custom markup, you can render individual fields or override the package views.
- Does maxlab/stacker store form submissions?
- Yes. Stacker includes functionality to store and manage form submissions, keeping persistence aligned with Laravel conventions. You can use the package's submission model or storage layer to save validated data. Review the package migrations and configure your database connection before accepting real submissions.
- How can I test forms built with maxlab/stacker?
- Write Laravel feature tests that post to the route handling your Stacker form, then assert validation errors and database records. Use RefreshDatabase or DatabaseTransactions to keep submission tables clean between tests. Unit-test custom field types and form definitions separately so rendering and validation failures are easy to isolate.
- Is maxlab/stacker actively maintained and safe for production?
- Before adopting it, check the repository's release history, issue activity, and Composer constraints on Packagist. Pin a specific version in composer.json and run your own test suite against your Laravel and PHP versions. For production, review the package's validation, storage, and view code paths that your app depends on.
- What are alternatives to maxlab/stacker for dynamic forms in Laravel?
- Alternatives include Filament form builders, Laravel Nova fields, Livewire-based form packages, and custom Blade or Livewire forms. Choose based on whether you need an admin UI, reusable field definitions, or tight control over validation and persistence. Stacker fits best when you want form structure defined in PHP and rendered through Blade.