Download the PHP package aayaresko/laravel-table without Composer
On this page you can find all versions of the php package aayaresko/laravel-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aayaresko/laravel-table
More information about aayaresko/laravel-table
Files in aayaresko/laravel-table
Package laravel-table
Short Description Simple HTML table builder for laravel 5
License MIT
Informations about the package laravel-table
Laravel Html table builder
HTML table builder for laravel 5
Installation
The preferred way to install extension is via composer. Check the composer.json for this extension's requirements and dependencies. To install, either run
or add
to the require section of your composer.json.
Configuration
It does not require any additional configuration.
Usage
Simply create a new instance of TablesFacade
and pass to it all required parameters:
$data_provider
is used as a models source.
It should be either an instance of Illuminate\Contracts\Pagination\LengthAwarePaginator
or Illuminate\Database\Eloquent\Collection
.
$attributes
array holds list of attributes, that should be rendered in each table row.
You can use 'dot' syntax to target attribute value of related models:
In your view you should place something like this:
You scan use renderLinks()
method only when you use Illuminate\Contracts\Pagination\LengthAwarePaginator
as $data_provider
.
You can specify custom column name for any attribute:
That custom name will be translated automatically.
You can attach a callback to render any attribute value:
Function signature is pretty straightforward: function ($model) {}
.
$default_actions_route
is route which will be used as 'parent' to generate links for all action buttons.
You can set <$default_actions_route to 'false'.
You can configure your own list of action buttons via $action_buttons
property.
Please be aware that route
and url
options are mutually exclusive.
You can remove $action_buttons
column by setting 'false' as $action_buttons
value.
You can specify any html options for any button via button options
array.
You can specify attributes values for the table itself, tr and td tags of the table via $table_options
, $row_options
and $item_options
respectively.
You can specify text, which will be displayed in case of no models via $not_found_text
.