tjventurini/contact

Contact form for my website.

This package's canonical repository appears to be gone and the package has been frozen as a result.

v0.0.10 2019-05-25 23:30 UTC

This package is auto-updated.

Last update: 2020-10-26 03:24:52 UTC


README

This package provides a simple contact form and routes for my website.

Installation

This package is available through packagist. Install it with the following command.

composer require tjventurini/contact

Config

You will need to publish the package configuraton.

php artisan vendor:publish --provider="Tjventurini\Contact\ContactServiceProvider" --tag=config

Translations (optional)

The translations are available through tags::tags.key even though you don't publish them.

php artisan vendor:publish --provider="Tjventurini\Contact\ContactServiceProvider" --tag=lang

Views

You will need to publish the package views in order to change them.

php artisan vendor:publish --provider="Tjventurini\Contact\ContactServiceProvider" --tag=views

Configuration

Validation

/*
 |--------------------------------------------------------------------------
 | Validation
 |--------------------------------------------------------------------------
 |
 | In this section you can change the validation rules for the contact form.
 |
 */

'rules' => [
    'name' => 'required|string|min:3',
    'email' => 'required|email',
    'message' => 'required|string',
],

Route Prefix

/*
 |--------------------------------------------------------------------------
 | Route Prefix
 |--------------------------------------------------------------------------
 |
 | In this section you can define the route prefix of this package.
 |
 */

'route_prefix' => 'contact',

Environment

# set mail drive to mailgun
MAIL_DRIVER=mailgun
...

# add mailgun credentials
MAIL_FROM_ADDRESS="john.doe@example.com"
MAIL_FROM_NAME="John Doe"
MAILGUN_DOMAIN="mailgun.example.com"
MAILGUN_SECRET="secret"

# reCaptcha
CAPTCHA_ENABLE=true
CAPTCHA_SITE_KEY="site-key"
CAPTCHA_SECRET="secret"