A contact form package to facilitate the life of the web developer.
This package is a PHP package built for Laravel 5.* & 6.*.
- Send e-mail with the verification token
- Set the name, email and message as validated
- Relaunch the process anytime
This project can be installed via Composer. To get the latest version of Laravel ContactForm, add the following line to the require block of your composer.json file:
{
"require": {
"queopius/laravel-contactform": "v1.0"
}
}
You'll then need to run composer install
or composer update
to download the
package and have the autoloader updated.
Or run the following command:
composer require queopius/laravel-contactform
Once Larvel ContactForm is installed, you need to register the service provider in config/app.php
.
Make sure to add the following line above the RouteServiceProvider
.
Queopius\LaravelContactform\ContactFormServiceProvider::class,
Publish the package config file by running the following command:
php artisan vendor:publish
The model representing the Contact
into the folder Models/.
To run the migrations from this package use the following command:
php artisan migrate --path="/vendor/queopius/laravel-contactform/src/database/migrations"
To customize the migration, publish it with the following command:
php artisan vendor:publish --provider="Queopius\LaravelContactform\ContactformServiceProvider" --tag="migrations"
This package provides a method to send an e-mail with a verification token.
By default the package will use the send_email_to
value defined into the
config/contact.php
file:
'send_email_to' => 'queopius@gmail.com', //Put your personal or company email here
If you want to override the value, simply set the $send_email_to
parameter.
Refer to the Laravel documentation for the proper e-mail component configuration.
The package allow you to use both traditional blade view files and markdown.
If you want to customize the e-mail views, run the following command to publish them and edit them to your needs:
php artisan vendor:publish --provider="Queopius\LaravelContactform\ContactformServiceProvider" --tag="views"
The view will be available in the resources/views/vendor/laravel-contactform/
directory.
By default the contact.blade.php
view will be loaded.
To customize the view, publish it with the following command:
php artisan vendor:publish --provider="Queopius\LaravelContactform\ContactformServiceProvider" --tag="views"
By default this packages ships with two routes.
To customize the routes into the routes/web.php, publish it with the following command:
php artisan vendor:publish --provider="Queopius\LaravelContactform\ContactformServiceProvider" --tag="routes"
Laravel Framework - Taylor Otwell
Feel free to comment, contribute and help.
Laravel ContactForm is licensed under The MIT License (MIT).