Table builders help you quickly build up table components.
You can instantiate a TableBuilder
instance and interact with it directly.
use Steams\Ui\Table\TableBuilder;
$builder = new TableBuilder($parameters = []);
Defining tables in your stream configuration makes it easy to display, filter, and customize tables based your domain information and entities.
Define stream tables using a handle => parameters
format, where handle
will be used to reference the table later and parameters
is an array of parameters and components configuration.
// streams/example.json
{
"ui": {
"tables": {
"default": {
"actions": {
"delete": {}
}
}
}
}
}
The following parameters are available.
{
"stream": null,
"table": null,
"views": [],
"filters": [],
"columns": [],
"buttons": [],
"actions": [],
"options": [],
"template": "ui::tables.table"
}
Name | Default | Description |
---|---|---|
stream | null | The contextual stream. |
table | default | The table configuration to use. |
views | [] | The table views. |
filters | [] | The table filters. |
columns | ['id' => []] | The table columns. |
buttons | [] | The table buttons. |
actions | [] | The table actions. |
template | ui::tables.table | The table template view. |
string|Stream
The stream to use for data and table configuration.
string
The specific stream table configuration to use. The default configuration will be used otherwise.
string
Use the builder
parameter to override the builder instance used to build the table component.
string
Use the repository
parameter to override the repository instance used to fetch the entry. This parameter defaults to the stream configured repository if any.
// streams/example.json
{
"ui": {
"tables": {
"default": {
"repository": "App\\MyTableRepository"
}
}
}
}
array
An array of table options.
Table configurations can also be @imports for more congiguration
{
"ui": {
"table": {}
}
}
Full configuration:
{
"ui": {
"tables": {
"default": {},
"{handle}": {}
}
}
}
use Steams\Ui\Table\TableBuilder;
$builder = new TableBuilder([
'stream' => 'contacts',
'columns' => [
'name',
'email',
],
]);
Configuration Examples
{
"table": [
// Required Configuration
"stream", // The stream the entry belongs to
// Optional Configuration
"repository", // The entry repository
"builder", // The table builder to use
"table", // The table component to use
"assets", // Assets to load
"views", // Table views configuration
"filters", // Table filters configuration
"columns", // Table columns configuration
"actions", // Table actions configuration
"buttons", // Table buttons configuration
"options": [ // Component options array
"sortable" // Enable sortable functionality
]
],
}
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.