Skip to content

Configure contact forms for your website and manage responses inside Filament

License

Notifications You must be signed in to change notification settings

neondigital/filament-contact-forms

Repository files navigation

Warning

This plugin is still in development and may not work correctly.

Filament Contact Forms

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Filament Contact Forms allow you to easily create customer-facing forms that can be emailed and managed inside Filament.

Installation

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

Usage

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([
            'one@test.com',
        ])
);

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([
            'one@test.com',
            'two@test.com',
        ])
        ->cc([
            'three@test.com',
            'four@test.com',
        ])
        ->bcc([
            'five@test.com',
            'six@test.com',
        ])
        ->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);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Configure contact forms for your website and manage responses inside Filament

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published