Yet another CRUD widgets for Laravel

1.0-beta.12 2020-09-14 07:46 UTC

This package is auto-updated.

Last update: 2024-04-06 16:06:55 UTC


README

tests Latest Stable Version Total Downloads

注意:lego 尚处于开发阶段,1.0版本发布之前主要接口仍有调整的可能性,请注意查看 release note !

Example

  • UserController.php
$form = Lego::form(new User());

$form->addText('number', '编号')->required()->rule('numeric')->unique();
$form->addText('email', '邮箱')->required()->rule('email')->unique();

return $form->view('layout', ['form' => $form]);
  • layout.blade.php
<!doctype html>
<html lang="en">
<head>
    <title>Lego Form</title>
    @include('lego::styles')
</head>
<body>
    {!! $form !!}
    @include('lego::scripts')
</body>
</html>

image

Required

  • php >= 7.1
  • Laravel >= 6.0

Installment

1、Composer

composer require wutongwan/lego

2、Publish lego assets

php artisan vendor:publish --tag=lego-assets --force

Tips:

To keep the assets up-to-date and avoid issues in future updates, you may add the command to the post-update-cmd scripts in your composer.json file:

{
     "scripts": {
         "post-update-cmd": [
             "@php artisan vendor:publish --tag=lego-assets --force"
         ]
     }
 }

Documents

Development

  • 分支

    • master, 在 master 下开发及维护
  • 当前版本在以下环境中开发并维护

    • Mac
    • Ubuntu
  • Run Demo

    php demo/run.php [--host=127.0.0.1] [--port=8080]

起因

用了快一年的zofe/rapyd-laravel,整体觉得非常好用,但内部确实不少代码年久失修,比较脏,有的组件也不适合中国的情况(比如google map)。

所以我们几个小伙伴想了很久,还是决定重新造个轮子,参考rapyd的思路,做一个我们自己用着更顺手的脚手架库。

起名Lego,也是向乐高致敬,能用简单的Block搭建摩天大厦是我们的梦想。

现在整体代码还是非常初级的版本,有兴趣的朋友欢迎关注以及和我们讨论,但由于整个项目是以提高团队自身效率为最优先前提的,可能我们会独断一些,不会刻意的做的太通用。