Simple Laravel Contact Us Form With Email Example

Today, We want to share with you Simple Laravel Contact Us Form With Email Example.In this post we will show you Create a Laravel Contact Us form with Email, hear for Laravel 5.7 Contact Form With File Attachment Script we will give you demo and example for implement.In this post, we will learn about Laravel 5.7 – Create Bootstrap Contact US Form using Form Request with an example.

Simple Laravel Contact Us Form With Email Example

There are the Following The simple About Simple Laravel Contact Us Form With Email Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop Sending Email Messages in Laravel 5.7, so the Submit Contact Form in PHP Laravel 5.7 with toastr notifications jquery for this example is following below.

Also Read This πŸ‘‰   PHP String Email word-char limit timestamp Examples

Setp 1 : Setup laravelcollective

Install Laravel Collective HTML Package with Install Laravel Application

cd myproject
cd myprojectname/public_html
composer require laravelcollective/html

Free Live Chat for Any Issue


// Laravel Add a Providers with aliases
'providers' => [
'aliases' => [
'Form' => 'Collective\Html\FormFacade',

Setp 2 : Database Configuration

the .env file >> Add the Laravel file settings credentials

DB_PORT=3306                                                                                               DB_USERNAME=example.db.username                                                                                           
DB_PASSWORD= example.db.password

Make Laravel Migrations for Feedback Us Table

php artisan make:migration create_feedback_us_table

database/migration/date_ create_feedback_us_table.php

increments('id'); $table->string('name'); $table->string('email'); $table->text('comment'); $table->timestamps(); });

    public function down()

Laravel run the following command

php artisan migrate

Setp 3 : Laravel Make The Model

Create a Laravel Model

php artisan make:model Feedback



namespace App;
use Illuminate\Database\Eloquent\Model;
class Feedback extends Model

public $table = 'feedbackus';
public $fillable = ['name','email','comment'];


Setp 4 : Define Laravel the Route


Route::get('feedback-us', '[email protected]');
Route::post('feedback-us', ['as'=>'','uses'=>'[email protected]']);

Setp 5 : Make a Laravel Controller


validate($request, [
        'name' => 'required',
        'email' => 'required|email',
        'comment' => 'required'


       return back()->with('success', 'Thanks for feedbacking us!');

Setp 6 : Make Laravel the View


<title>Laravel 5.7 Feedback Form Example</title>

<div class="pakainfo container">
<h1>Feedback Form</h1>
<p>Laravel Contact Form With File Attachment Script</p>

   <div class="alert alert-success">
     {{ Session::get('success') }}

{!! Form::open(['route'=>'']) !!}

<div>has('name') ? 'has-error' : '' }}">
{!! Form::label('Member Name:') !!}
{!! Form::text('name', old('name'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Name']) !!}
<span class="text-danger">{{ $errors->first('name') }}</span>

<div>has('email') ? 'has-error' : '' }}">
{!! Form::label('Member Email:') !!}
{!! Form::text('email', old('email'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Email']) !!}
<span class="text-danger">{{ $errors->first('email') }}</span>

<div>has('comment') ? 'has-error' : '' }}">
{!! Form::label('Comment:') !!}
{!! Form::textarea('comment', old('comment'), ['class'=>'Feedback form-control', 'placeholder'=>'Enter Member Comment']) !!}
<span class="text-danger">{{ $errors->first('comment') }}</span>

<div class="pakainfo form-group">
<button class="gst btn btn-success">Feedback US!</button>

{!! Form::close() !!}



You received a comment from : {{ $name }}
Member Name: {{ $name }}

Member Email: {{ $email }}

Comment: {{ $user_comment }}

Laravel Sending the Email

php artisan make:mail 

first of all My account > Login as well as Security > Login to Google

MAIL_USERNAME= [email protected]


validate($request, [ 'name' => 'required', 'email' => 'required|email', 'comment' => 'required' ]);

           'name' => $request->get('name'),
           'email' => $request->get('email'),
           'user_comment' => $request->get('comment')
       ), function($comment)
       $comment->from('[email protected]');
       $comment->to('[email protected]', 'Admin')->subject('Pakainfo Feedback');

    return back()->with('success', 'Thanks for feedbacking us!'); 

Angular 6 CRUD Operations Application Tutorials

Read :

Also Read This πŸ‘‰   Laravel Create Update Delete and Getters eloquent methods


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Simple Laravel Contact Us Form With Email Example.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Rate this post