jperez8 / laravel-contact

Laravel package that permits adding contact form and it's functionality to your laravel application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy Contact Form for Your Laravel App

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', 'john.doe@example.com'),

];

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.

About

Laravel package that permits adding contact form and it's functionality to your laravel application


Languages

Language:JavaScript 39.2%Language:PHP 29.4%Language:HTML 19.6%Language:CSS 11.8%