承接 custom-d/cd-contact-form 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

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

NamePurpose
CD_CONTACT_FORM_NOTIFICATION_EMAILSRaw email addresses that admin notifications will be sent to (comma separated)
NOCAPTCHA_SECRETThe secret for NoCaptcha
NOCAPTCHA_SITEKEYThe 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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-17