定制 solution-forest/simple-contact-form 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

solution-forest/simple-contact-form

Composer 安装命令:

composer require solution-forest/simple-contact-form

包简介

This is my package simple-contact-form

README 文档

README

Simple-Contact-Form

Simple Contact Form - FilamentPHP Plugin

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.

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

Features

  • 🚀 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

Pro Version (Click me)

  • 📁 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

Try Pro Version Now

 https://checkout.anystack.sh/simple-contact-form-pro

Supported Filament versions

Filament Version Plugin Version
v3 0.0.6
v4/v5 >=2.0.0

Installation

You can install the package via composer:

composer require solution-forest/simple-contact-form

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:

  1. Filament v3 with Tailwind v3:
    Follow the official Filament installation instructions: https://filamentphp.com/docs/3.x/forms/installation.

  2. Filament v3 with Tailwind v4:
    Publish the built-in CSS assets with the following command:

    php artisan vendor:publish --tag="simple-contact-form-assets"
  3. Filament v4/v5 :
    Add the following to your app.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

Configuration

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

Customizing Translations

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.

Email Setting

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=your-email@example.com
MAIL_PASSWORD=your-email-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@example.com
MAIL_FROM_NAME="${APP_NAME}"

Usage

Creating a Form

  1. Navigate to the "Contact Forms" section in your Filament admin panel
  2. Click "Create Form"
  3. Configure the basic form settings:
    • Form Name
    • Email Content
    • Success Message
    • Error Message
    • Email Subject
  4. Add fields using the form builder:
    • Text Input
    • Email Input
    • Textarea
    • Select Dropdown
    • Radio Buttons
    • Checkboxes

Displaying Forms

Use the Blade component with form id in your views:

<x-simple-contact-form :form="1" />

Preview

image image image image image image

Common Issues

Emails not sending:

  • Check your mail configuration in .env
  • Verify SMTP credentials
  • Check Laravel log files
  • smtp doc

Testing

composer test

Changelog

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

Contributing

We welcome contributions! Please see CONTRIBUTING.md 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 Solution Forest

Solution Forest Web development agency based in Hong Kong. We help customers to solve their problems. We Love Open Sources.

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
  • Website CMS Management: A hands-on Filament CMS plugin for those who prefer more manual control over their website content management.

solution-forest/simple-contact-form 适用场景与选型建议

solution-forest/simple-contact-form 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 435 次下载、GitHub Stars 达 12, 最近一次更新时间为 2025 年 06 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「solutionforest」 「simple-contact-form」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 solution-forest/simple-contact-form 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 solution-forest/simple-contact-form 我们能提供哪些服务?
定制开发 / 二次开发

基于 solution-forest/simple-contact-form 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 435
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-23