添加formbuilder插件:

Composer应用

composer require kris/laravel-form-builder

下载成功

修改配置文件

在config/app.php

‘providers’ => [

  Kris\LaravelFormBuilder\FormBuilderServiceProvider::class,

]

‘aliases’ =>[

  'FormBuilder' =>  Kris\LaravelFormBuilder\Facades\Formbuilder::class,

]

创建form

Php artisan make:form Forms/名字–fields =“name:text,intro:text”

生成的文件

public function buildForm()

{

    $this

        ->add('name', 'text', [

            'rules' => 'required|min:5'

        ])

        ->add('lyrics', 'textarea', [

            'rules' => 'max:5000'

        ]);

}

创建一个空的form

Php artisan make:form Forms/名字

public function buildForm()

{

    }

控制器

引用:

use Kris\LaravelFormBuilder\FormBuilder;

函数:

public function create(FormBuilder $formBuilder){

    $form = $formBuilder->create(\App\Form\PostForm::class,[

       'method' => 'POST',

        'url' => route('photo.store')

    ]);

    return view('Photo.form',compact('form'));

}

视图:

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <title></title>

</head>

<body>

  {!! form($form) !!}

</body>

</html>

Laravel Form-builder使用的更多相关文章

  1. Oracle EBS Form Builder使用Java beans创建窗体

    最近有个项目,需要研究一下Oracle的E-Business Sutie(EBS),对于以前没接触此套件的我来说,简直太痛苦了.在网上找了一堆资料,试着进行Form二次开发,也遇到各类奇葩问题.目前遇 ...

  2. 使用Form Builder创建Form具体步骤

    使用Oracle Form Builder创建Form具体步骤 (Data Source为Table) 说明:当Block使用的Data Source为Table时,Form会自动Insert,Upd ...

  3. [Form Builder]Oracle Form系统变量中文版总结大全

    转:http://yedward.net/?id=57 Form中的系统变量,它存在于一个Form的整个运行时期的会话之中,变量包含了有关Form相关属性的字节信息.有些变量标明了当前状态,还有些变量 ...

  4. [Form Builder]NAME_IN()与COPY()

    NAME_IN和COPY实际是间接引用,类似指针传递,而不是值传递... IF :VAR1 IS NULL ...  direct referenceIF NAME_IN ( :VAR1 ) IS N ...

  5. [Form builder]:about SYSTEM.MESSAGE_LEVEL

    If you want to suppress error messages then you have to set a system variable :system.message_level. ...

  6. WordPress Plugin Contact Form Builder [CSRF → LFI]

    # Exploit Title: Contact Form Builder [CSRF → LFI]# Date: 2019-03-17# Exploit Author: Panagiotis Vag ...

  7. Oracle Form Builder

    Oracle Form Builder 是Oracle的一个开发工具,可以针对Oracle公司的E-Business Suit的ERP系统开发的.对应的还有reports builder. Oracl ...

  8. Laravel Query Builder 复杂查询案例:子查询实现分区查询 partition by

    案例 案例:Laravel 在文章列表中附带上前10条评论?,在获取文章列表时同时把每个文章的前10条评论一同查询出来. 这是典型分区查询案例,需要根据 comments 表中的 post_id 字段 ...

  9. 表单生成器(Form Builder)之伪造表单数据番外篇——随机车辆牌照

    前几天记录了一下表单生成器(Form Builder)之表单数据存储结构mongodb篇,之后便想着伪造一些数据.为什么要伪造数据呢?说来惭愧,因为拖拉拽设计表单以及表单对应的列表的PC端和移动端该显 ...

  10. 表单生成器(Form Builder)之表单数据存储结构mongodb篇

    从这篇笔记开始,记录一下表单生成器(Form Builder)相关的一些东西,网上关于他的介绍有很多,这里就不解释了. 开篇说一下如何存储Form Builder生成的数据.

随机推荐

  1. Direct2D 第4篇 渐变画刷

    原文:Direct2D 第4篇 渐变画刷 #include <windows.h> #include <d2d1.h> #include <d2d1helper.h> ...

  2. 外贸电子商务网站之Prestashop 设置网站基本信息

    顶部banner图,首页各尺寸banner图.社交分享.物流支持.支付方式提醒等等设置 示例版本:1.6.1.11

  3. laravel学习文档

    https://github.com/barryvdh/laravel-debugbar Laravel 精选资源大全 http://laravelacademy.org/post/153.html ...

  4. Effective Modern C++:08调整

    41:针对可复制的形参,在移动成本低且一定会被复制的前提下,考虑将其按值传递 class Widget { public: void addName(const std::string& ne ...

  5. 如何把一个普通的Eclipse项目改造成Eclipse Plugin项目

    New Project->Plug-in from existing JAR Archive 同时要记得不仅要将你要转换的项目的jar包选上,同时还要将项目依赖的jar包全部选上(要不然会找不到 ...

  6. op应用:官方,wifidog,portal,uci,luci,脚本,框架,usb

    http://wiki.openwrt.org/doc/starthttp://downloads.openwrt.org/docs/buildroot-documentation.htmlhttp: ...

  7. python的解释器类型

    Python解释器 当我们编写Python代码时,我们得到的是一个包含Python代码的以.py为扩展名的文本文件.要运行代码,就需要Python解释器去执行.py文件. 由于整个Python语言从规 ...

  8. 寒哥带你深入了解下Swift中的Value Type

    http://www.cocoachina.com/swift/20150923/13539.html 关于开发到底使用ValueType 值类型还是Reference Type 引用类型,关于这个, ...

  9. linux cat /etc/passwd 说明

    通常在Linux系统中,用户的关键信息被存放在系统的/etc/passwd文件中,系统的每一个合法用户账号对应于该文件中的一行记录.这行记录定义了每个用户账号的属性.下面是一个passwd文件的示例( ...

  10. 2018-9-30-VisualStudio-使用多个环境进行调试

    title author date CreateTime categories VisualStudio 使用多个环境进行调试 lindexi 2018-09-30 18:39:26 +0800 20 ...