adityar15/contactform 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adityar15/contactform

Composer 安装命令:

composer require adityar15/contactform

包简介

A contact form package using Livewire and Tailwind CSS

README 文档

README

Whenever user fills up the detail and clicks send message, you receive an email at the email address specified by you. It is built using Livewire and Tailwind CSS

Pre Requisites:

Livewire 2.x

Installation

To install use the following command

composer require adityar15/contactform

Publising view and config files

Once install publish the config and view files.

php artisan vendor:publish --provider="adityar15\contactform\ContactFormServiceProvider"

Blade file changes

In your blade file include tailwind cdn

<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">

Now in the same blade file wherever you would like to have the contact form just include these two lines

  @livewire('adityar15contactform')
  @livewireScripts
  

Usage

If you do not wish to use tailwind and have your own custom styling, you can do it by editing the blade file.

You can edit the stylings of the form by editing the view file in the resources/views/vendor/contactform/contactform.blade.php You can edit the email template from the view file in the resources/views/vendor/contactform/emailtemplate.blade.php

Alternatively you can change the email template blade from the config file. The config file is named as contactform.php.

<?php


return [
    'mail'=>[
        'mail_to' => env('MAIL_FROM_ADDRESS'),
        'mail_to_name'=> 'admin'
    ],

    'emailtemplate'=>'vendor.contactform.emailtemplate', 
	/**email template. Insert the blade file name which you want to be rendered for email. In this case emailtemplate is file located in side resources/views/vendor/contactform **/

    'subject_line' =>'Someone contacted you on your website',
	// subject line for your email
	
    'thankyou_message' => 'Thank you for contacting us. We will get back to you shortly.'
	//thank you message displayed to the user after successfull form submission
];

If you are using a custom email template then make a note to add following variables in the email blade file:

$name for yourname, $body for the message, $fromname for user's name who contacted you, $fromemail for user's email who contacted you

Screenshot

alt text

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固