A lightweight, customizable contact form plugin for FilamentPHP that provides an easy-to-use alternative to Contact Form 7. Build and manage contact forms with a simple, intuitive interface directly from your Filament admin panel.
- 🚀 Easy Installation - Get up and running in minutes
- 📝 Basic Form Management - Create and manage contact forms
- 📧 Email Notifications - Receive form submissions via email
- 📱 Responsive Design - Mobile-friendly forms out of the box
- 📁 File Upload - Support for file attachments in forms
- 🪝 Form Hooks - Before/after submit hooks for custom logic
- ⚙️ Configuration Options - Adjustable settings for forms
- 💾 Submission Storage - Save and manage form submissions
https://checkout.anystack.sh/simple-contact-form-pro
Filament Version | Plugin Version |
---|---|
v3 | 0.0.6 |
v4 | 2.0.2 |
You can install the package via composer:
composer require solution-forest/simple-contact-form
For Filament v4, use the v2.0.1 version:
composer require solution-forest/simple-contact-form:^2.0.2
You can publish and run the migrations with:
php artisan vendor:publish --tag="simple-contact-form-migrations"
php artisan migrate
Register the plugin in your Panel provider:
use SolutionForest\SimpleContactForm\SimpleContactFormPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
SimpleContactFormPlugin::make(),
]);
}
Simple Contact Form provides a Filament form that can be used outside the Filament panel, but it requires Filament styles. There are several ways to set this up depending on your environment:
-
Filament v3 with Tailwind v3:
Follow the official Filament installation instructions: https://filamentphp.com/docs/3.x/forms/installation. -
Filament v3 with Tailwind v4:
Publish the built-in CSS assets with the following command:php artisan vendor:publish --tag="simple-contact-form-assets"
-
Filament v4 (expects Tailwind v4):
Add the following to yourapp.css
or your stylesheet:@import '../../vendor/filament/filament/resources/css/theme.css'; @source '../../app/Filament/**/*'; @source '../../resources/views/filament/**/*';
Then build your assets:
npm run build
You can customize the plugin's resources using the following options:
SimpleContactFormPlugin::make()
->modelLabel('Custom Contact Form') // Singular label for the model
->pluralModelLabel('Custom Contact Forms') // Plural label for the model
->navigationLabel('My Contact Forms') // Label in the navigation menu
->navigationIcon('heroicon-o-envelope') // Icon for navigation
->navigationGroup('Communication') // Group in the navigation
->navigationSort(100) // Sort order in navigation
->navigationParentItem(null) // Parent navigation item (if any)
->slug('contact') // Custom route slug
->shouldSkipAuth(false) // Require authentication
->shouldRegisterNavigation(true) // Show in navigation
->hasTitleCaseModelLabel(true); // Use title case for labels
If you need to modify the translations, publish the language files:
php artisan vendor:publish --tag="simple-contact-form-lang"
This will copy the language files to your application's lang
directory where you can edit them.
For the plugin to send emails properly, ensure your Laravel mail configuration is set up correctly in your .env
file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=[email protected]
MAIL_PASSWORD=your-email-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"
- Navigate to the "Contact Forms" section in your Filament admin panel
- Click "Create Form"
- Configure the basic form settings:
- Form Name
- Email Content
- Success Message
- Error Message
- Email Subject
- Add fields using the form builder:
- Text Input
- Email Input
- Textarea
- Select Dropdown
- Radio Buttons
- Checkboxes
Use the Blade component with form id in your views:
<x-simple-contact-form :form="1" />
Emails not sending:
- Check your mail configuration in
.env
- Verify SMTP credentials
- Check Laravel log files
- smtp doc
composer test
Please see CHANGELOG for more information on what has changed recently.
We welcome contributions! Please see CONTRIBUTING.md for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
Solution Forest Web development agency based in Hong Kong. We help customers to solve their problems. We Love Open Soruces.
We have built a collection of best-in-class products:
- InspireCMS: A full-featured Laravel CMS with everything you need out of the box. Build smarter, ship faster with our complete content management solution.
- Filaletter: Filaletter - Filament Newsletter Plugin