landmark/landmark-web-component
最新稳定版本:1.0.1
Composer 安装命令:
composer require landmark/landmark-web-component
包简介
A reusable Laravel Livewire contact form component package
README 文档
README
A reusable Laravel Livewire contact form component that can be easily integrated into any Laravel application.
Features
- 🚀 Easy integration with Laravel/Livewire applications
- 🎨 Multiple themes (Default, Bootstrap, Tailwind)
- ⚡ Real-time validation
- 📧 Multiple submission handlers (email, database, webhook, custom)
- 🔧 Highly configurable
- � Event-driven architecture
- 📱 Responsive design
Installation
Install the package via Composer:
composer require landmark/landmark-web-component
Laravel Auto-Discovery
The package will automatically register itself. If you have auto-discovery disabled, add the service provider to your config/app.php:
'providers' => [ // ... Landmark\LandmarkWebComponent\LandmarkWebComponentServiceProvider::class, ],
Publish Configuration (Optional)
Publish the configuration file to customize the component:
php artisan vendor:publish --tag=landmark-web-component-config
Publish Views (Optional)
Publish the views if you want to customize the component appearance:
php artisan vendor:publish --tag=landmark-web-component-views
Quick Start
Basic Usage
Add the component to any Blade template:
<livewire:landmark-contact-form />
With Custom Options
<livewire:landmark-contact-form :theme="'bootstrap'" :submit-text="'Get In Touch'" :title-text="'Contact Our Team'" :show-title="true" :redirect-after-submit="'/thank-you'" />
'submitText' => 'Send Now',
'showTitle' => true,
'redirectAfterSubmit' => '/thank-you'
])
## Configuration
### Environment Variables
Add these to your `.env` file:
```env
CONTACT_FORM_HANDLER=email
CONTACT_FORM_EMAIL=admin@example.com
CONTACT_FORM_SUBJECT="New Contact Form Submission"
CONTACT_FORM_WEBHOOK_URL=https://your-webhook.com/endpoint
Available Themes
default- Clean design with Tailwind CSSdark- Dark theme variantminimal- Minimalist designbootstrap- Bootstrap-styled form
Submission Handlers
-
Log Handler (default)
CONTACT_FORM_HANDLER=log
-
Email Handler
CONTACT_FORM_HANDLER=email CONTACT_FORM_EMAIL=admin@example.com
-
Database Handler
CONTACT_FORM_HANDLER=database
-
Webhook Handler
CONTACT_FORM_HANDLER=webhook CONTACT_FORM_WEBHOOK_URL=https://your-webhook.com/endpoint
-
Custom Handler
CONTACT_FORM_HANDLER=custom
Advanced Usage
Custom Event Handling
Listen for form submissions in your components:
protected $listeners = ['contactFormSubmitted' => 'handleContactForm']; public function handleContactForm($formData) { // Custom logic here }
Custom Styling
Publish the views and modify the Blade template:
php artisan vendor:publish --provider="YourVendor\LivewireContactForm\LivewireContactFormServiceProvider" --tag="views"
Then edit: resources/views/vendor/livewire-contact-form/contact-form.blade.php
Requirements
- PHP ^8.2
- Laravel ^9.0|^10.0|^11.0
- Livewire ^2.0|^3.0
License
MIT License
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-27