PHPackages                             aimsinfosoft/laravel-contact-form - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aimsinfosoft/laravel-contact-form

ActivePackage

aimsinfosoft/laravel-contact-form
=================================

laravel contact form package

1.05(1y ago)17MITCSS

Since Dec 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/aimsinfosoft/laravel-contact-form)[ Packagist](https://packagist.org/packages/aimsinfosoft/laravel-contact-form)[ RSS](/packages/aimsinfosoft-laravel-contact-form/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Laravel-contact-form package
============================

[](#laravel-contact-form-package)

The laravel contact form package is a customizable and easy-to-use package designed to quickly integrate a fully functional contact form into any Laravel project. This package provides seamless form management, email notifications, and storage of contact form submissions in the database.

Installation
============

[](#installation)

To install the package, run the command:

```
composer require aimsinfosoft/laravel-contact-form
```

After installation, you need to publish the configuration file:

```
php artisan vendor:publish --tag=contactform-config
```

After installation, you need to publish the public assets file:

```
php artisan vendor:publish --tag=public
```

After installation, you need to Change in `config/contactform.php` file.

Locate the following line:

```
'admin_email'=> 'admin_email'=>env('ADMIN_EMAIL','');

```

Change it to:

```
'admin_email'=>env('MAIL_FROM_ADDRESS','');

```

After making the changes, you need to follow these steps to create a new database and set SMTP details in the `.env` file

#### Database Configuration

[](#database-configuration)

```
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=laravel_contact
DB_USERNAME=root
DB_PASSWORD=
```

#### SMTP Configuration

[](#smtp-configuration)

```
MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=test@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
```

After that, you can run the migration:

```
php artisan migrate

```

After that, you need to run this command.

```
php artisan serve

```

Usage
-----

[](#usage)

#### Registering the routes

[](#registering-the-routes)

#### Define contact form types

[](#define-contact-form-types)

Default configuration file include default contact form type with `name`,` email`, `message`fields.

```
 public function store(Request $request)
    {
        $validated = $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'message' => 'required'
        ]);
        contact::create($validated);

        $admin_email=\config('contactform.admin_email');
        if($admin_email===null || $admin_email===''){ echo 'The value of admin email not set';
        }
        Mail::to($validated['email'])->send(new contact_mail($validated));
        return back()->with('success', 'Your message has been sent successfully!');
    }

```

#### Examples

[](#examples)

Here is example of sends email to the administrator and users.

```
Mail::to($validated['email'])->send(new contact_mail($validated));
```

Request to contact-form :

```
your-project-url/contact-form
```

Example:

```
http://127.0.0.1:8000/contact-form

```

#### Error response:

[](#error-response)

```
@error('name')
    {{ $message }}
@enderror
@error('email')
    {{ $message }}
@enderror
@error('message')
    {{ $message }}
@enderror

```

#### Success response:

[](#success-response)

```
@session('success')
    {{ session('success')}}
@endsession

```

You can see the frontend contact form by using this URL: `http://127.0.0.1:8000/contact-form`.

Customization
-------------

[](#customization)

### Overriding a View File

[](#overriding-a-view-file)

To override a view file from a package (e.g., `vendor/aimsinfosoft/laravel-contact-form/example.blade.php`), you should follow these steps:

Steps:

- Create the folder structure: Inside the `resources/views` directory, create the `vendor/contactform/` folder.

    Path:

    ```
    resources/views/vendor/contactform/

    ```
- #### Copy the package’s view file:

    [](#copy-the-packages-view-file)

    Copy the view file (e.g., `example.blade.php`) from the package’s `vendor/contactform/` directory into the newly created folder in `resources/views/vendor/contactform/`.

    example:

    ```
    resources/views/vendor/contactform/example.blade.php

    ```

### Overriding a Controller File

[](#overriding-a-controller-file)

To override a controller file from a package (e.g., `vendor/aimsinfosoft/laravel-contact-form/src/Http/Controllers/ExampleController.php`), follow these steps:

Steps:

- Create the folder structure: Inside the `app/Http/Controllers/` directory, create the necessary subfolders to match the package’s controller file location.

    Path:

    ```
    app/Http/Controllers/vendor/contactform/src/Http/Controllers/

    ```
- Copy the package’s controller file: Copy the controller file (e.g., `ExampleController.php`) from the package’s `vendor/contactform/src/Http/Controllers/` directory into the `app/Http/Controllers/vendor/contactform/src/Http/Controllers/` directory.

    example:

    ```
    app/Http/Controllers/vendor/contactform/src/Http/Controllers/ExampleController.php

    ```

### Overwrite the Assets Folder

[](#overwrite-the-assets-folder)

To override a assets folder from a package, you need to run this command:

```
php artisan vendor:publish --tag=public

```

After installation, you need to check a public folder in the directory.

exmple:

```
public/vendor/contactform

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance40

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

502d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/852b0116b3ab96566377c0115cb2d1d69aaef95c42db94b10f7b285c99de2d17?d=identicon)[aimsinfosoft](/maintainers/aimsinfosoft)

---

Top Contributors

[![KeyurGajera1](https://avatars.githubusercontent.com/u/137153453?v=4)](https://github.com/KeyurGajera1 "KeyurGajera1 (16 commits)")[![nayanalraaei](https://avatars.githubusercontent.com/u/175922453?v=4)](https://github.com/nayanalraaei "nayanalraaei (4 commits)")

### Embed Badge

![Health badge](/badges/aimsinfosoft-laravel-contact-form/health.svg)

```
[![Health](https://phpackages.com/badges/aimsinfosoft-laravel-contact-form/health.svg)](https://phpackages.com/packages/aimsinfosoft-laravel-contact-form)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
