dialect-katrineholm / tablify
Installs: 2 636
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- barryvdh/laravel-dompdf: ^2.0
- maatwebsite/excel: ^3.1
This package is auto-updated.
Last update: 2024-11-24 17:13:09 UTC
README
Tablify makes creating data-tables in multiple formats easier.
Installation
Install via composer
composer require dialect-katrineholm/tablify
Publish config
php artisan vendor:publish --provider="Dialect\Tablify\TablifyServiceProvider"
Usage
#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