Warning
This plugin is still in development and may not work correctly.
Filament Contact Forms allow you to easily create customer-facing forms that can be emailed and managed inside Filament.
You can install the package via composer:
composer require neondigital/filament-contact-forms
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-contact-forms"
php artisan migrate
Simple example
use NeonDigital\ContactForms\Facades\ContactForm;
ContactForm::register(
Form::make('catalog_request')
->schema([
// Filament Fields / Layouts
TextInput::make('name')->label('Full Name')->minLength(2)->required(),
])
->mailable(CatalogMailable::class)
->recipients([
'[email protected]',
])
);
Advanced example
use NeonDigital\ContactForms\Facades\ContactForm;
ContactForm::register(
Form::make('catalog_request')
->schema([
// Filament Fields / Layouts
TextInput::make('name')->label('Full Name')->minLength(2)->required(),
])
->mailable(CatalogMailable::class)
->recipients([
'[email protected]',
'[email protected]',
])
->cc([
'[email protected]',
'[email protected]',
])
->bcc([
'[email protected]',
'[email protected]',
])
->loopRecipients(false) // avoids the CC/BCC getting spammed!
->mailer('postmark')
->queue(true)
);
Submit form
use NeonDigital\ContactForms\Facades\ContactForm;
ContactForm::get('catalog_request')
->validation([
'g-recaptcha-response' => 'required',
])
->submit($request);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.