PHPackages                             kevinorriss/contactform - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. kevinorriss/contactform

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

kevinorriss/contactform
=======================

A basic contact form of email address, message and Google ReCaptcha validation

1.1.1(9y ago)1186MITHTML

Since Jul 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kevinorriss/contactform)[ Packagist](https://packagist.org/packages/kevinorriss/contactform)[ Docs](https://github.com/kevinorriss/contactform)[ RSS](/packages/kevinorriss-contactform/feed)WikiDiscussions master Synced 4w ago

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

ContactForm
===========

[](#contactform)

A simple contact form where a user enters their email address, message and passes a Google reCAPTCHA robot test. The message is then sent to the configured email address.

How it works
------------

[](#how-it-works)

This library adds contact form functionality to your Laravel application. Two new routes (get and post) are set up under the "contact" url. A view needs to be set up, but this library provides a partial containing the form HTML, or you may create your own view with application specific layout and CSS styles.

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

[](#installation)

1. Add ContactForm to your composer.json file under `require`:

`"kevinorriss\contactform": "1.1.*"`

2. Add the ContactFormServiceProvider to your app.php file:

`KevinOrriss\ContactForm\ContactFormServiceProvider::class,`

4. Run `composer update`

Usage
-----

[](#usage)

### Google reCAPTCHA

[](#google-recaptcha)

This library makes use of Google's reCAPTCHA to help stop the contact form being spammed. In order to use this follow these steps:

1. Follow the `Usage` section from [Google's reCAPTCHA READMME file](https://packagist.org/packages/google/recaptcha#1.1.2), to generate a site key and secret for your application.
2. Add your reCAPTCHA secret and key to your application environment file, for example:

```
RECAPTCHA_SECRET=my_recaptcha_secret
RECAPTCHA_SITE_KEY=my_recaptcha_site_key

```

### Email configuration

[](#email-configuration)

You must first set up your mail driver, please refer to the Laravel documentation for this.

1. Add the following to your application's environment file

```
CONTACT_FORM_EMAIL=example@myapplication.com
CONTACT_FORM_NAME="Example Name"

```

This is the email address that the users message will be sent to.

2. Add these optional settings to your environment file

```
CONTACT_FORM_SUBJECT=""
CONTACT_FORM_SUCCESS=""

```

These allow you to override the subject of the email and also the flash message that the users sees when the email is sent successfully.

Example
-------

[](#example)

### A simple view

[](#a-simple-view)

To get going, create a file named `contact.blade.php` in the `resources/views` folder and add the following:

```

        Contact Form
        @include('contactform::stylesheet')

                @include('contactform::form', ['heading' => 'Contact Me'])

        @include('contactform::javascript')

```

This form uses Bootstrap for style which is included in the `contactform::stylesheet`partial.

When including the form itself, you can provide an optional array with a heading key which overrides the panel heading (defaults to "Contact Form").

By default, the contact form controller will look for `contact.blade.php`, you can override this by creating an entry in your application's environment file such as:

`CONTACT_FORM_VIEW="mycontactformview"`

You will then need to name your view file to match this.

### Javascript

[](#javascript)

The `contactform::javascript` partial includes three extra partials, one each for:

1. jQuery (contactform::jquery)
2. Bootstrap (contactform::bootstrap)
3. reCAPTCHA (contactform::recaptcha)

If your template already includes jQuery or bootstrap, or you simply do not want to use bootstrap then you can replace the `contactform::javascript` partial and use only the ones you need.

Authors
-------

[](#authors)

- **Kevin Orriss** - [Website](http://kevinorriss.com)

See also the list of [contributors](https://github.com/kevinorriss/contactform/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

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

Every ~111 days

Total

3

Last Release

3425d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17672510?v=4)[Kevin Orriss](/maintainers/kevinorriss)[@kevinorriss](https://github.com/kevinorriss)

---

Top Contributors

[![kevinorriss](https://avatars.githubusercontent.com/u/17672510?v=4)](https://github.com/kevinorriss "kevinorriss (6 commits)")

---

Tags

formcontact

### Embed Badge

![Health badge](/badges/kevinorriss-contactform/health.svg)

```
[![Health](https://phpackages.com/badges/kevinorriss-contactform/health.svg)](https://phpackages.com/packages/kevinorriss-contactform)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[craftcms/contact-form-honeypot

Add a honeypot captcha to your Craft CMS contact form

25129.8k3](/packages/craftcms-contact-form-honeypot)[janvince/smallcontactform

Simple but flexible multi language contact form builder with custom fields, validation and passive antispam

307.7k](/packages/janvince-smallcontactform)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1040.9k5](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

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