Seiten · Laravilt
Resources
CRUD screens for Eloquent models, built from forms, tables and infolists.
Resources are the core building blocks of a panel. Each one represents CRUD screens for an Eloquent model: a list page (table), create and edit pages (form), and a view page (infolist).
Creating a Resource
The command asks for the panel and the database table, then generates the resource from the table's columns. You can pass everything up front:
| Argument / option | Description |
|---|---|
panel | Target panel (prompted if omitted) |
--table= | Database table to generate from |
--model= | Model class name |
--simple | Generate one Manage{Model} page instead of List/Create/Edit/View |
For a users table in the Admin panel it generates:
If you enable them, it also creates Api/UserApi.php and Ai/UserAi.php.
Basic Resource
$modelis typedstringand$navigationSortis typedinton the base class. Redeclare them with the same types (?string/?intcause a PHP fatal error).
Labels & Slug
Override getLabel(), getPluralLabel() or getNavigationLabel() for translated labels:
In this section
- Resource Forms: create/edit forms and view infolists
- Resource Tables: list page tables
- Authorization: permission checks
- Relation Managers: manage related records
- Nested Resources: child resources under a parent
- Resource API: REST endpoints
- API Actions: custom API endpoints
- Resource AI: AI agents and global search
- AI Columns: columns the AI can use