Before I moved to Laravel, I spent years building sites in WordPress, and Gravity Forms was one of the first plugins I installed on almost every one of them. It wasn't until I switched to Laravel that I realized how much work Gravity Forms had been doing for me.
Every client site needs at least one form, and a contact form is never just a contact form.
Someone needs an email when a submission comes in, and the person who filled it out should probably get a confirmation. You need spam protection, or you'll have 200 messages about SEO services by Friday. Somebody will want to attach a file, and eventually the client will ask where they can see all the submissions and whether they can get them in a spreadsheet.
After rebuilding that stack on project after project, I built a Laravel form builder that handles all of it and made it part of ArtisanPack UI.
What is ArtisanPack UI Forms?
Forms is a free, open-source form builder and management package for Laravel, released under the MIT license.
You build forms in a visual, drag-and-drop builder, and Forms takes care of everything after that: storing submissions, sending notifications, handling file uploads, blocking spam and passing data along to other services.
I built it with client sites in mind. On those projects, someone other than me eventually needs to add a field or change who gets the notification email, and with Forms they can open the builder and do it themselves.
Here's what you need to run it:
- PHP 8.2 or higher
- Laravel 11, 12 or 13 (Laravel 13 requires PHP 8.3 or higher)
- Livewire 3.6 or 4
Getting started in three commands
Install the package with Composer, publish the configuration and assets, and run the migrations:
composer require artisanpack-ui/forms
php artisan vendor:publish --provider="ArtisanPackUI\Forms\FormsServiceProvider"
php artisan migrate
That's the whole setup. The form builder lives at /admin/forms by default, and you can change that path with the FORMS_ADMIN_PREFIX environment variable.
To show a form on the front end, load it by its slug in your controller:
$form = FormService::getBySlug('contact');
return view('contact', ['form' => $form]);
Then drop the renderer into your Blade view:
<livewire:form-renderer :form="$form" />
If you want to fill in some fields ahead of time, pass a :prefill array to the renderer. This works for fields that have dynamic population turned on, like a plan the visitor picked or a logged-in user's email address:
<livewire:form-renderer :form="$form" :prefill="['plan' => 'pro', 'email' => auth()->user()?->email]" />
Success messages and redirects are set per form in the admin, under the form's Settings tab, so your template code stays small and changing a thank-you message doesn't require a deploy.
Build forms visually with the drag-and-drop form builder
Forms ships with more than 35 field types, sorted into four groups.
| Group | Field types |
|---|---|
| Basic | Text, Email (with optional confirmation), Phone, Number, URL, Text Area (with optional rich text), Hidden |
| Choice | Dropdown (optionally searchable), Radio, Single Checkbox, Toggle, Checkbox Group, Multi-Select |
| Advanced | File Upload, Date, Time, Date & Time, Date Range, Rating, Slider, Color, Net Promoter Score, Likert/Matrix, Ranking, Name, Address, List, Calculation, Signature, Consent, CAPTCHA |
| Layout | Section, Heading, Paragraph, Divider, Custom HTML |
Choice fields can show images, include an "Other" option, or pull their options from predefined lists or dynamic sources, so nobody has to type out all 50 states again.
Every input field also comes with a handful of extra settings:
- Read-only for values the visitor should see but not change.
- Dynamically populated for values filled in from your app or the URL.
- Admin label so a question like "What's the best way to reach you?" shows up as "Contact preference" in your submissions.
- Administrative for fields only admins fill in on the submission, like internal notes or a follow-up status.
- Private for data that needs extra care, which I'll cover in the privacy section below.
Going beyond the contact form
Once you have a builder, contact forms are just the start. Long forms can be split into multiple steps with a progress indicator, and conditional logic can show or hide individual fields, or entire steps, based on earlier answers.
Here are a few things you can build without writing custom form code:
- A job application that collects contact info on step one, work history on step two and a résumé upload on step three.
- An event registration where a "Bringing a guest?" toggle reveals fields for the guest's name.
- A client intake questionnaire that uses Rating, Likert and Net Promoter Score fields to see where a project stands.
- A quote request that uses a Calculation field to show an estimated total.
- A service agreement with Signature and Consent fields at the end.
What happens after someone clicks submit
Collecting the data is only half the job, and Forms handles the other half too.
Submissions. Every entry lands in the admin, where you can list, view and manage submissions. When the client asks for a spreadsheet, you can export to CSV.
Notifications. Each form can send admin alerts and autoresponders, both with templates, so the office gets an email and the visitor gets a confirmation.
Webhooks. You can send each submission to another service, and every request is signed with HMAC so the receiving end can verify it came from your app. Webhooks are off by default, and you turn them on with FORMS_WEBHOOKS_ENABLED=true.
Events. Forms dispatches standard Laravel events: FormCreated, FormSubmitted and SubmissionDeleted. You can listen for FormSubmitted to create a CRM record, open a support ticket or kick off anything else your app needs to do.
Spam protection and privacy are built in
Any public form is a spam magnet, so Forms gives you three layers of protection: a honeypot field, rate limiting and CAPTCHA. CAPTCHA supports Cloudflare Turnstile, hCaptcha, reCAPTCHA v2 and reCAPTCHA v3. Turnstile is the default, and switching providers takes one environment variable:
FORMS_CAPTCHA_DRIVER=turnstile
Forms also tend to collect personal information, so the package includes tools for handling it responsibly:
- Do not store lets you use a field's value during the submission (in a notification, for example) without saving it to the database.
- Masking hides sensitive values in the admin.
- Timed redaction clears sensitive values after a set number of days.
You can also decide how long submissions stick around. Forms keeps them forever by default, but you can setFORMS_RETENTION_DAYSand then run the prune command, either by hand or on a schedule:
php artisan forms:prune-submissions
Adding --days overrides the configured retention for a single run.
File uploads go to a private disk with MIME type validation and a size limit of 10 MB by default. And if several clients or teams share one app, policy-based authorization with ownership support can limit people to the forms they own. You can turn that on with FORMS_RESTRICT_BY_OWNER=true.
Accessible by default
Accessibility is the reason ArtisanPack UI exists, and forms are where accessibility goes wrong most often on the web. Forms is built on the Livewire UI Components and Accessibility packages, and the renderer handles the details that are easy to miss when you build forms by hand:
- Labels are tied to every input. If you hide a label visually, it stays available to screen readers, and required fields are announced as required.
- Errors are connected to their fields. Invalid inputs are marked as invalid, and each input points to its description and error message so screen readers read them together.
- Failed submissions are announced. When validation fails, whether on submit or when moving to the next step, the errors are announced in a live region and focus moves to the first invalid field.
- Groups are labeled as groups. Radio buttons and checkbox groups are grouped and labeled, so screen reader users hear the question before the choices.
- Multi-step forms keep everyone oriented. The progress indicator is a labeled navigation region that marks the current step, and step changes are announced.
The builder gets the same attention. Its controls have descriptive labels, like "Delete Email address" in place of a bare trash icon, and you can reorder steps from the keyboard.
React and Vue support
Forms started on Livewire, but it also ships React and Vue components for apps with a JavaScript front end. Each framework gets its own form renderer, multi-step form component and admin components, and they all talk to the package's REST API. Client-side validation and conditional logic live in shared modules, so a form behaves the same way no matter which front end renders it.
Here's what the React renderer looks like:
import { FormRenderer } from './vendor/artisanpack-forms/react';
<FormRenderer baseUrl="/api/v1/forms" formSlug="contact" />
The REST API is also the route to take if you want a headless setup or a classic POST submission in place of Livewire.
Making it your own
Forms uses the ArtisanPack UI Hooks package, so you can change its behavior without forking it. Hooks follow the ap.forms.* naming convention. With notifications, for example, hooks let you change recipients, subjects and bodies, or run your own code before or after an email goes out.
If you used Forms before version 1.6.0, the older forms.* hook names still work as deprecated aliases. They log a notice when they run and will be removed in the next major version.
When you need a field type Forms doesn't have, version 1.6.0 added field type handlers. A handler is one class that defines everything about a field type: its builder settings, validation rules, how its value is stored, and how it's displayed and exported. Here's a trimmed-down version of the IBAN example from the docs:
namespace App\Forms;
use ArtisanPackUI\Forms\FieldTypes\AbstractFieldType;
use ArtisanPackUI\Forms\Models\FormField;
class IbanFieldType extends AbstractFieldType
{
protected string $key = 'iban';
protected function defineType(): array
{
return [
'label' => __( 'IBAN' ),
'icon' => 'o-banknotes',
'category' => 'advanced',
'has_options' => false,
'supports_placeholder' => true,
];
}
protected function typeRules( FormField $field ): array
{
return ['string', 'regex:/^[A-Z]{2}\d{2}[A-Z0-9 ]{11,40}$/i'];
}
public function normalize( FormField $field, mixed $value ): mixed
{
return is_string( $value ) ? strtoupper( str_replace( ' ', '', $value ) ) : $value;
}
}
Then register it in a service provider and add it to the builder's palette:
addFilter( 'ap.forms.fieldTypes', function ( array $types ): array {
$types['iban'] = IbanFieldType::class;
return $types;
} );
addFilter( 'ap.forms.fieldCategories', function ( array $categories ): array {
$categories['advanced']['fields'][] = 'iban';
return $categories;
} );
The Livewire, React and Vue builders all render a field type's settings from its definition, so your custom type gets builder controls without any front-end code.
For everything else, you can publish the config file to config/artisanpack/forms.php:
php artisan vendor:publish --tag=forms-config
Optional AI features
If you install the ArtisanPack UI AI package (version 1.0 or higher), Forms can use four AI agents. Each one has its own toggle, and none of them run unless you turn them on.
- Spam detection scores submissions for spam.
- Submission summaries send periodic digests of themes and follow-ups across your entries.
- Response classification sorts submissions into categories.
- Smart validation checks whether an answer makes sense for its field, so "asdf" in a company name field gets caught.
How Forms fits into ArtisanPack UI
Forms is a good example of how the ecosystem fits together. It uses Livewire UI Components for its interface, Security for safe handling of input, Accessibility for its accessible foundation and Hooks for extensibility.
It also works with the Media Library package. If you install Media Library, file uploads from your forms can be stored as media items alongside the rest of your site's media.
Start building
Install Forms with composer require artisanpack-ui/forms, and you'll have a working form builder in a few minutes. The full documentation lives in the Forms wiki, and you can browse the code and star the repo on GitHub. If you find a bug or have an idea, open an issue. I'd love to hear what you build with it.
Want more posts like this? Subscribe to The ArtisanPack UI Dispatch for monthly tips, tutorials and package updates, and get the Quick Start Cheat Sheet free when you sign up.


