PHPackages                             grofgraf/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. grofgraf/laravel-contact-form

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

grofgraf/laravel-contact-form
=============================

Contact form for Laravel

1.0.0(7y ago)029MITPHP

Since Sep 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/GrofGraf/laravel-contact-form)[ Packagist](https://packagist.org/packages/grofgraf/laravel-contact-form)[ RSS](/packages/grofgraf-laravel-contact-form/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Contact Form
====================

[](#laravel-contact-form)

Contact form package for Laravel. Automatic creation of routes, controllers, email templates and views needed for contact form. Option of enabling captcha validation and sending mail attachments.

Requiremenets
-------------

[](#requiremenets)

- `Laravel 5.5` or above
- Configure your mail settings to make sure your server can send emails.
- [Google reCAPTCHA](https://www.google.com/recaptcha) key, if you want to have human verification enabled.

Installation
------------

[](#installation)

```
 $ composer require grofgraf/laravel-contact-form
```

Configuration
-------------

[](#configuration)

First add the service provider to the main configuration file located at `config/app.php`

```
'providers' => [
  ...
  GrofGraf\LaravelContactForm\Providers\ContactServiceProvider::class
]
```

Now you can navigate to `/contact` and you will see a default contact form.

### Recaptcha

[](#recaptcha)

If you want to enable human verification, you have to register a site with [Google reCAPTCHA](https://www.google.com/recaptcha) and receive a pair of keys.

After that, you can add those keys to your `.env` file.

```
RECAPTCHA_SITEKEY=
RECAPTCHA_SECRET=
```

If only site key is defined, the client side validation is performed without server validation

If both keys are defined client and server side validation is performed.

If client key or both keys are undefined, no validation is performed and reCAPTCHA widget is not displayed by default.

### Mail attachments

[](#mail-attachments)

By default, all mime types are enabled for mail attachment. You can disable or enable mail attachment, or change allowed mime types, by editing the configuration file. To do so, you want to publish the configuration file by running

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

In the `config` directory `contact.php` file will be generated, where you can change `attachment_mimetypes` value.

To allow only certain mime types list them as array:

```
...
'attachment_mimetypes' => ['application/pdf', 'text/*'],
...
```

By leaving array empty `'attachment_mimetypes' => []`, attachment will be disabled and input field won't be shown in email form.

To allow all mime types for attachment, set the value to `'attachment_mimetypes' => ['*']`.

Usage
-----

[](#usage)

### Overriding configurations

[](#overriding-configurations)

To override configuration file, run `php artisan vendor:publish --tag=config` command, that will create `config/contact.php` file. By editing this file you can choose between different configuration options, like enabling or disabling autoreply and human verification, adding addresses to mail carbon copy (cc), or choosing attachment mime types.

> If you don't want to publish configuration file, you can override some options by assigning variables in `.env` file.

### Overriding views

[](#overriding-views)

If you want to make changes to the views, you can publish them by running `php artisan vendor:publish --tag=views` in the root of your project.

By running this command the files that override the default views will be generated and stored to the `/resources/views/contact` directory. Now you can edit them as you wish and make then fit your needs. By default, available variables for your email templates are:

- `$name` name of the sender
- `$email` email of the sender
- `$subject` email subject
- `$content` content of email

### Overriding mailables

[](#overriding-mailables)

By running `php artisan vendor:publish --tag=mail` command, `Contact.php` and `Autoreply,php` files will be generated in `app\Mail` directory. In these file you can override mail logic.

### Override controllers

[](#override-controllers)

By running `php artisan vendor:publish --tag=controllers` command, 'ContactController.php' will be generated in `app\Mail` directory. Here you can override controllers logic.

### Overriding routes

[](#overriding-routes)

By running `php artisan vendor:publish --tag=routes` command, `contact.php` file will be generated in `routes` directory. In this file, you can override used paths or assign them to different controllers.

Authors
-------

[](#authors)

- [GrofGraf](https://github.com/GrofGraf)

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2017 GrofGraf

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2789d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7421b36bfe47a407affd4856712fad4429e2bde3d5ad2757ca6f78c3ca79871?d=identicon)[GrofGraf](/maintainers/GrofGraf)

---

Top Contributors

[![GrofGraf](https://avatars.githubusercontent.com/u/16609463?v=4)](https://github.com/GrofGraf "GrofGraf (7 commits)")

---

Tags

laravelformcontactgrofgrafcontact formcontactformlaravel-contact-form

### Embed Badge

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

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[barryvdh/laravel-form-bridge

This packages integrates Symfony Form Component in Laravel.

163354.8k1](/packages/barryvdh-laravel-form-bridge)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[bakame/laravel-domain-parser

Laravel package to integrate PHP Domain parser.

26534.8k4](/packages/bakame-laravel-domain-parser)

PHPackages © 2026

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