custom-d/cd-contact-form
最新稳定版本:v1.2.4
Composer 安装命令:
composer require custom-d/cd-contact-form
包简介
Base Contact form package for laravel installs
README 文档
README
installation
composer require custom-d/cd-contact-form
run php artisan cdcontactform:install to install
or Manuallu Publish the Migration and optionally the translations / config file
php artisan vendor:publish --tag=cd-contact-form-migrations
php artisan vendor:publish --tag=cd-contact-form-config
php artisan vendor:publish --tag=cd-contact-form-translations
php artisan migrate
(optional) Update your user model and add a the following scope:
public function scopeContactFormNotify(Builder $query): Builder
{
return $query->where('role' , 'admin');
}
customimize the query according to your project.
If you would rather list the mail addresses, see the CD_CONTACT_FORM_NOTIFICATION_EMAILS Environmental Variable instead.
Environmental Variables
You'll need these variables set in your .env file.
NoCaptcha is used by default, you can obtain keys from Google
| Name | Purpose |
|---|---|
| CD_CONTACT_FORM_NOTIFICATION_EMAILS | Raw email addresses that admin notifications will be sent to (comma separated) |
| NOCAPTCHA_SECRET | The secret for NoCaptcha |
| NOCAPTCHA_SITEKEY | The key for NoCaptcha |
Configuration File
Many things are customisable via the published config file. Refer to documentation within the file.
Validation Rules
Validation rules can be set in the config file - under the key validation_rules and the messages under the key validation_messages
Translations
The notification emails are translatable with the following values available
Admin Notifications
subject: 'New message received from :Name',greeting: '',body_before: '### The following information was supplied',body_after: '',
Customising additional field display:
in your AppServiceProvider boot method add:
AdminNotification::formatFieldsUsing(fn($name) => str($name)->replace('_', ' ')->title()->toString());
统计信息
- 总下载量: 299
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-17