dialect-katrineholm / tablify
0.6.0
2023-10-24 14:50 UTC
Requires
- barryvdh/laravel-dompdf: ^2.0
- maatwebsite/excel: ^3.1
This package is auto-updated.
Last update: 2024-09-24 16:53:49 UTC
README
Tablify使得以多种格式创建数据表变得容易。
安装
通过composer安装
composer require dialect-katrineholm/tablify
发布配置
php artisan vendor:publish --provider="Dialect\Tablify\TablifyServiceProvider"
使用方法
#basic usage tablify($collection)->text('Header', 'mapping')->toHtml(); //tablify automatically gets properties from data tablify($articles) ->text('Category', 'category.name') ->text('Name', 'name') ->currency('Price', 'price'); //Or it can take a closure ->text('popular', function($item){ return $item->sells > 5 ? 'Yes' : 'No'; }); #groups //if an item in the data contains a array itself you can loop over it using group tablify($categories) ->text('Category', 'name') ->group('articles', function($tablify){ //In here you can access the tablfiy builder for every article. }); #Settings //TODO