PHPackages                             nf/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. nf/contact-form

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

nf/contact-form
===============

Contact Form package

7.0.0(6y ago)0381[15 PRs](https://github.com/nf-theme/contact-form/pulls)MITPHPPHP &gt;=5.6

Since Jan 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nf-theme/contact-form)[ Packagist](https://packagist.org/packages/nf/contact-form)[ RSS](/packages/nf-contact-form/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (4)Versions (53)Used By (0)

Contact Form
============

[](#contact-form)

- [Contact Form](#contact-form)
    - [Install Migrate and Form package.](#install-migrate-and-form-package)
    - [Installation](#installation)
        - [Install Through Composer](#install-through-composer)
        - [Add the Service Provider](#add-the-service-provider)
        - [Run migrate command](#run-migrate-command)
        - [Register your option scheme](#register-your-option-scheme)
        - [How to use](#how-to-use)
        - [Custom layout for paginator](#custom-layout-for-paginator)

Install Migrate and Form package.
---------------------------------

[](#install-migrate-and-form-package)

> Install Migrate and Form package is require

Refer to the instructions here:

- [Migrate](https://github.com/nf-theme/contact-form)
- [Form](https://github.com/nf-theme/form)

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

[](#installation)

### Install Through Composer

[](#install-through-composer)

```
composer require nf/contact-form

```

### Add the Service Provider

[](#add-the-service-provider)

Open `config/app.php` and register the required service provider.

```
  'providers'  => [
        // .... Others providers
        \Vicoders\ContactForm\ContactFormServiceProvider::class
    ],
```

### Run migrate command

[](#run-migrate-command)

Run commands below to create needed file and migrate database

```
// publish needed file
php command contact:publish
```

```
// migrate database
php command migrate
```

### Register your option scheme

[](#register-your-option-scheme)

> You can add your option scheme to `functions.php`

All supported type can be found here

- [Input](https://github.com/nf-theme/inputs/blob/master/src/Abstracts/Input.php)
- [Type](https://github.com/nf-theme/inputs/blob/master/src/Abstracts/Type.php)

```
use Vicoders\Input\Abstracts\Input;
use Vicoders\Input\Abstracts\Type;
use Vicoders\ContactForm\Facades\ContactFormManager;

ContactFormManager::add([
    'name'   => 'Contact',
    'type'   => Type::CONTACT,
    'style'  => 'form-1',
    'email_enable' => true, /* default - false */
    'email_variables' => [
        'name'  => 'NAME_FIELD',
        'email' => 'EMAIL_FIELD'
    ],
    'email_config' => [
        'domain_api'      => 'http://sendmail.vicoders.com/',
        'mail_host'       => 'HOST MAIL',
        'mail_port'       => 'PORT',
        'mail_from'       => 'EMAIL_FROM',
        'mail_name'       => 'YOUR NAME',
        'mail_username'   => 'EMAIL SEND',
        'mail_password'   => 'EMAIL PASSWORD',
        'mail_encryption' => 'tls',
    ],
    'email_template' => [
        [
            'name' => 'Template 1',
            'path' => 'PATH_TO_HTML_TEMPLATE',
            'params' => [
                'name_author' => 'Garung 123',
                'post_title'  => 'this is title 123',
                'content'     => 'this is content 123',
                'link'        => 'http://google.com',
                'site_url'    => site_url(),
            ]
        ],
        [
            'name' => 'Template 2',
            'path' => 'PATH_TO_HTML_TEMPLATE',
            'params' => [
                'example_variable' => 'demo'
            ]
        ]
    ],
    'status' => [
        [
            'id' => 1,
            'name' => 'pending',
            'is_default' => true
        ],
        [
            'id' => 2,
            'name' => 'confirmed',
            'is_default' => false
        ],
        [
            'id' => 3,
            'name' => 'cancel',
            'is_default' => false
        ],
        [
            'id' => 4,
            'name' => 'complete',
            'is_default' => false
        ]
    ],
    'fields' => [
        [
            'label'      => 'Text',
            'name'       => 'firstname', // the key of option
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-6 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Text',
            'name'       => 'lastname', // the key of option
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-6 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Email',
            'name'       => 'email', // the key of option
            'type'       => Input::EMAIL,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'      => 'Phone',
            'name'       => 'phone',
            'type'       => Input::TEXT,
            'attributes' => [
                'required'   => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'label'             => 'Choose Size',
            'name'              => 'choose-size',
            'type'              => Input::SELECT,
            'list'              => [
                '0'       => '--- option ---',
                'size-l'  => 'Size L',
                'size-x'  => 'Size X',
                'size-xl' => 'Size XL',
            ],
            'selected'          => 'size-xl',
            'selectAttributes'  => [
                'class' => 'col-sm-12 form-control',
            ],
            'optionsAttributes' => [
                'placeholder' => 'Please fill field',
                'required'          => true,
            ],
        ],
        [
            'label'      => 'Textarea',
            'name'       => 'textarea',
            'type'       => Input::TEXTAREA,
            'attributes' => [
                'required'          => true,
                'class'       => 'col-sm-12 form-control',
                'placeholder' => 'Please fill field',
            ],
        ],
        [
            'name'       => 'date',
            'type'       => Input::DATE,
            'attributes' => [
                'required'   => 'true',
                'class'       => 'col-sm-12 form-control email-inp-wrap',
                'placeholder' => __('Hãy nhập email của bạn', 'contactmodule'),
            ],
        ],
        [
            'value'       => 'Submit',
            'type'       => Input::SUBMIT,
            'attributes' => [
                'class'       => 'btn btn-primary btn-submit',
                'placeholder' => __('Hãy nhập email của bạn', 'contactmodule'),
            ],
        ],
    ],
]);
```

> If `selected` attribute of Input::SELECT is not set, it'll automatically check title of current page with items in list which you set at `list` attribute.

### How to use

[](#how-to-use)

The package create a shortcode called `nf_contact_form` with a attribute `name`, you can use it wherever you want

```
[nf_contact_form name="{form_name}"]
```

Example:

```
[nf_contact_form name="Contact"]

```

```
do_shortcode("[nf_contact_form name='Contact']")
```

### Custom layout for paginator

[](#custom-layout-for-paginator)

> {tip} You can change layout for pagination by adding new template file `resources/views/vendor/option/pagination/default.blade.php`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 68.8% 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 ~17 days

Recently: every ~73 days

Total

37

Last Release

2422d ago

Major Versions

v2.0.9 → v3.0.02018-01-31

3.1.8 → 4.0.02018-12-10

4.0.0 → 5.0.02018-12-10

v5.0.1 → 6.0.02019-03-27

6.0.0 → 7.0.02019-09-27

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/3bbdd95f61a0f401f1df7329c631647011c2ff72a745afe50f70d0ca7ad871ed?d=identicon)[khiemchay](/maintainers/khiemchay)

---

Top Contributors

[![k62bcntt](https://avatars.githubusercontent.com/u/12668807?v=4)](https://github.com/k62bcntt "k62bcntt (44 commits)")[![nightfury-est](https://avatars.githubusercontent.com/u/20170474?v=4)](https://github.com/nightfury-est "nightfury-est (13 commits)")[![garungabc](https://avatars.githubusercontent.com/u/24909843?v=4)](https://github.com/garungabc "garungabc (3 commits)")[![namth1996](https://avatars.githubusercontent.com/u/21118623?v=4)](https://github.com/namth1996 "namth1996 (2 commits)")[![nguyendinhkhiem](https://avatars.githubusercontent.com/u/30714081?v=4)](https://github.com/nguyendinhkhiem "nguyendinhkhiem (2 commits)")

### Embed Badge

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

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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