auto() table()
Add a text column for every field of the data, with edit, delete and active buttons unless told otherwise.
table()->auto($params = [])Options
| Option | Meaning |
|---|---|
auto_no_buttons | No row buttons. |
(any table option) | Every other key is set as a table option, as in table($data, $params). |
Example
| Id | Login | Add date | |
|---|---|---|---|
| 1 | anna | [email protected] | 2026-11-01 |
| 2 | bohdan | [email protected] | 2026-11-03 |
Code
$rows = [
1 => ['id' => 1, 'login' => 'anna', 'email' => '[email protected]', 'add_date' => '2026-11-01'],
2 => ['id' => 2, 'login' => 'bohdan', 'email' => '[email protected]', 'add_date' => '2026-11-03'],
];
return table($rows)->auto(['auto_no_buttons' => 1, 'no_pages' => 1, 'condensed' => 1]);Notes
- Columns are added when the data is known, at render time, so other columns given before or after
auto()come first. - Handy in admin prototypes; a page for visitors names its columns.
See also: table/table, demo:table/auto, form/auto