nf / contact-form
Contact Form package
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.3
- league/csv: ^8.0
- nf/core: >=2.0
- nf/form: ^1.0
- dev-master
- 7.0.0
- 6.0.0
- v5.0.1
- 5.0.0
- 4.0.0
- v3.18
- v3.17
- 3.1.8
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.3.3
- dev-dependabot/npm_and_yarn/css-what-2.1.3
- dev-dependabot/npm_and_yarn/node-sass-7.0.0
- dev-dependabot/npm_and_yarn/tar-2.2.2
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/jquery-3.5.0
This package is auto-updated.
Last update: 2024-11-07 21:20:10 UTC
README
Install Migrate and Form package.
Install Migrate and Form package is require
Refer to the instructions here:
Installation
Install Through Composer
composer require nf/contact-form
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 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
You can add your option scheme to
functions.php
All supported type can be found here
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 atlist
attribute.
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
{tip} You can change layout for pagination by adding new template file
resources/views/vendor/option/pagination/default.blade.php