omh/laracontact 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

omh/laracontact

Composer 安装命令:

composer require omh/laracontact

包简介

A Contact Us form for Laravel application

README 文档

README

Laracontact

Laracontact

Laracontact is a Contact us form for your laravel applications with spam protection through Google reCaptcha V2.
The package store a contact request with (name, email, subject and message) in the database and send it by email to admins.

Installation

composer require omh/laracontact
  • The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [
    // ...
    Laracontact\LaracontactServiceProvider::class,
];
  • You should publish the migration and the config/contact_request.php config file with:
php artisan vendor:publish --tag="laracontact-migration"
php artisan vendor:publish --tag="laracontact-config"
  • After the config and migration have been published and configured, you can create the contact_requests table by running the migration:
php artisan migrate

Usage

The contact us form is availabe by default at /contact-us
You can customize the form path on the config file.

Default config file contents

return [
    /*
     * Set the form path.
     */
    'form_path' => '/contact-us',

    /*
     * Set the url redirection after submitting the contact us form.
     */
    'redirectTo' => '/',

    /*
    * Set the contact us page title.
    */
    'page_title' => 'Contact us',

    /*
     * Array of emails that should receive the contact request
     */
    'notifiables' => ['admin@test.test'],

    /*
     * Set to false to disable sending emails feature
     */
    'send_mails' => true,

    /*
     * To configure correctly please visit https://developers.google.com/recaptcha/docs/start
     */
    'recaptcha' => [

        /*
         *
         * The secret key
         * get site key @ www.google.com/recaptcha/admin
         *
         */
        'recaptcha_secret' => env('RECAPTCHA_SECRET'),

        /*
         *
         * The secret key
         * get site key @ www.google.com/recaptcha/admin
         *
         */
        'recaptcha_sitekey' => env('RECAPTCHA_SITEKEY'),
    ]

];
  • You can change the redirection url after the contact submission
    /*
     * Set the url redirection after submitting the contact us form.
     */
     'redirectTo' => '/my-custom-redirection',
  • You can change the contact us page title
    /*
     * Set the url redirection after submitting the contact us form.
     */
     'page_title' => 'My Custome title',
  • You can add admin's emails in the notifiables array
    /*
     *  Array of emails that should receive the contact request
     */
     'notifiables' => ['admin@test.test'],
  • You can disable sending emails by setting the 'send_emails' to false
    /*
     * Set to false to disable sending emails feature
     */
    'send_mails' => false,

Customize the Contact Us form

If you want to customize the contact us form you can run

php artisan vendor:publish --tag="laracontact-views"

The views will now be located in the resources/views/vendor/contact_request/ directory

Use your own Maillable/Notifiable

A Laracontact\Events\ContactRequestEvent event is fired each time a contact request is submitted. You can add listeners in your app/Providers/EventServiceProvider.php file and trigger your own maillable

    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Laracontact\Events\ContactRequestEvent::class => [
            // your own listeners
        ],
    ];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固