laraform/laraform-laravel
最新稳定版本:1.2.1
Composer 安装命令:
composer require laraform/laraform-laravel
包简介
Laraform Community Edition (Laravel)
README 文档
README
This repository contains the Laravel package of Laraform's Community Edition.
Check out laraform/laraform repo or Documentation for more details.
Installation
composer require laraform/laraform-laravel
Usage
// app/Forms/MyFirstForm.php <?php namespace App\Forms; use Laraform; class MyFirstForm extends Laraform { public $schema = [ 'hello_world' => [ 'type' => 'text', 'label' => 'Hello', 'default' => 'World' ] ]; }
Pass the form to the view:
// routes/web.php Route::get('/', function () { return view('welcome', [ 'form' => app('App\Forms\MyFirstForm') ]); });
Render:
<!-- resources/views/welcome.blade.php ---> <html> <head> <!-- ... ---> <meta name="csrf-token" content="{{ csrf_token() }}"> <link rel="stylesheet" type="text/css" href="/css/app.css"> </head> <body> <div id="app"> {!! $form->render() !!} </div> <script src="/js/app.js"></script> </body> </html>
Please note that you need the Larafrom Vue package in order to make this work.
统计信息
- 总下载量: 36.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-17