ricadesign/laravel-contact

Creates contact backend and scaffolds frontend of contact form

Installs: 85

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:HTML

Type:li

v0.3.0 2019-02-14 13:15 UTC

README

This composer package offers a setup for contact form. Provides a default view for the contact form, set routes for the contact form view and the submit of the form, and adds the controller logic to send the information of the form to an email adress.

Installation

Begin by pulling in the package through Composer.

composer require ricadesign/laravel-contact

Next, if using Laravel 5, include the service provider within your config/app.php file. From version 5.5 and thanks to package autodiscovery this is no longer necesary.

'providers' => [
    Ricadesign\Contact\ContactServiceProvider::class,
];

Configuration

You can configure the email adress where the contact form message is sent to by adding the following variables to the .env file.

CONTACT_MAIL=john.doe@example.com

If you need to modify the form view, you can publish the form view with the following command:

php artisan vendor:publish

This will also publish the config file, contact.php. Wich you can modify to add the email adress:

<?php

return [

    'email' => env('CONTACT_MAIL'),

];

Usage

Once installed you can navigate to the "/contact" URL of you web application. This will show the default view or, in case you have published the view, the custom view for the contact form.

There is a route for "/contact" that's expecting a post method with the message information to be sent to the contact email.