Creates contact backend and scaffolds frontend of contact form
ricadesign/laravel-contact is a Laravel package for creates contact backend and scaffolds frontend of contact form.
It currently has 5 GitHub stars and 1.411 downloads on Packagist (latest version v1.0.98).
Install it with composer require ricadesign/laravel-contact.
Discover more Laravel packages by ricadesign
or browse all Laravel packages to compare alternatives.
Last updated
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.
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,
];
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[email protected]
If you need to modify the form view, you can publish the form view with the following command:
php artisan vendor:publish --tag=ricadesign/laravel-contact
This will also publish the config file, contact.php, which you can modify to add the email address or disable the default GET route:
<?php
return [
'email' => env('CONTACT_MAIL', '[email protected]'),
'use_default_get_route' => true,
];
Once installed you can navigate to the "/contact" URL of your web application (assuming use_default_get_route config option is set to true). This will show the default view or, in case you have published the view, the custom view for the contact form. You can also generate links to this route using the 'contact' route name.
There is a route for "/contact" that's expecting a post method with the message information to be sent to the contact email.