this will send email to admin and save contact query in database
To install the Contact, (*2)
first download via composer by running the command composer require dreamaker\contact
if you do not have composer you could just clone this repo, (*3)
after download, (*4)
Then include or into your project directory and put this at the top of you class or file
use Dreamaker\Contact\Contact;
, (*5)
you do not need to add this to your service provider it will be autoloaded, (*6)
You will need to configure you mail driver in your env file i.e, (*7)
MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=yourusername MAIL_PASSWORD=yourpassword MAIL_ENCRYPTION=tls
then now create a migration table called contact
Schema::create('contacts', function (Blueprint $table) {
$table->increments('id');
$table->text('message');
$table->string('email');
$table->string('name');
$table->timestamps();
});
, (*8)
then run php artisan migrate
, (*9)
which will create your datebase table, (*10)
when this is done, then you are ready to use laravel contact us, (*11)
to change admin email create contact.php file in your config folder then put this inside it, (*12)
return [
'send_email_to' => 'youremail@domain.com'
];
, (*13)
to access contact page simple type <yourdomain.com/contact>
to access contact page
it will automatically take the view stying of all your layouts, (*14)
Contact is free software distributed under the terms of the MIT license., (*15)
Please report any issue you find in the issues page.
Pull requests are welcome., (*16)