tysdever/eloquenttable

用于laravel集合的HTML表格生成器,Steve Bauman包的升级版

dev-master 2016-11-23 17:58 UTC

This package is not auto-updated.

Last update: 2024-09-20 18:38:58 UTC


README

用于简单创建表格的组件。

安装

Composer
"repositories": [ {
        "type": "vcs",
        "url": "https://piotr_theis@bitbucket.org/etdcms/repository.git"
    } , {
        "type": "vcs",
        "url": "https://piotr_theis@bitbucket.org/etdcms/eloquenttable.git"
    }.
    ...
"require": {
        "php": ">=7.0",
        "laravel/framework": "5.2.*",
        "tysdever/eloquenttable": "dev-master",
        ...
Laravel

config/app.php

'providers' => [
    ...
    Tysdever\EloquentTable\EloquentTableServiceProvider::class,
发布文件
脚本

为了正确运行,还需要添加已发布的JavaScript脚本。

$ php artisan vendor:publish --provider="Tysdever\EloquentTable\EloquentTableServiceProvider" --tag="js"

此命令将在/resources/assets/vendor/tysdever/eloquenttable目录中发布eloquenttable.js脚本,需要将其添加到gulpfile.js中,如果gulpfile.js中存在该条目

'vendor/tysdever/**/*.js'

那么你可以忽略添加脚本。你需要做的是在控制台中运行gulp编译器

$ gulp
视图

如果由于未知原因需要编辑视图,可以使用以下命令发布视图

$ php artisan vendor:publish --provider="Tysdever\EloquentTable\EloquentTableServiceProvider" --tag="views"

此命令将在/resources/views/vendor/tysdever/eloquenttable目录中发布视图,从现在起,你可以享受Laravel的灵活性。

i18n

与上述相同,只需更改标签为lang。在/lang/vendor/tysdever/eloquenttable目录中发布。

配置

这里可能不需要太多解释,但我会记录下来以便知道可以做到。

使用

控制器
模型
视图

基础组件

https://github.com/stevebauman/eloquent-table