dragonfly / lists
Laravel DataTables 生成器/请求处理器。
此软件包的官方仓库似乎已消失,因此软件包已被冻结。
1.2.5
2016-02-28 09:34 UTC
Requires
- php: >=5.4.0
- illuminate/config: 5.0.x|5.1.x|5.2.x
- illuminate/database: 5.0.x|5.1.x|5.2.x
- illuminate/http: 5.0.x|5.1.x|5.2.x
- illuminate/support: 5.0.x|5.1.x|5.2.x
- illuminate/view: 5.0.x|5.1.x|5.2.x
- memio/memio: ~1.0
This package is not auto-updated.
Last update: 2024-06-05 22:26:34 UTC
README
DragonFly\Lists
是一个 Laravel 5 软件包,它使得为您的前端代码设置 dataTables 变得简单,同时还可以处理获取数据所需的请求。
我对这个问题采取了与 Laravel 自己的 Request
表单类似的方法。
安装
首先运行 composer require
composer require dragonfly/lists
然后打开 app/config/app.php
并添加 serviceProvider
'DragonFly\Lists\ServiceProvider',
完成之后,打开 app/Http/Kernel.php
,我们需要向类中添加一个特质和一个新的属性
use \DragonFly\Lists\Http\KernelTrait; /** * DataTable definitions (the key is used as a slug for routing) * * @var array */ protected $tables = [];
最后,您将在 app/Http
中创建一个名为 Tables
的新文件夹,您就可以开始使用了。
但是,如果您想使用包含的配置文件和资源,您可以在终端运行以下命令
php artisan php artisan vendor:publish --provider="DragonFly\Lists\ServiceProvider" --tag="merge"
如果您想调整视图或语言文件,可以使用以下命令发布它们
php artisan vendor:publish --provider="DragonFly\Lists\ServiceProvider" --tag="solid"
功能
- Laravel 5 支持
- 支持
Eloquent
和QueryBuilder
作为数据源 - 灵活渲染
- 轻松生成骨架定义
- 提供可选的表格批量操作
- 完整的本地化支持
- 完全文档化
文档
我在 readme.io 上编写了文档。