Páginas · Laravilt
Relation Managers
Manage related records from inside a resource's view or edit page.
Relation managers let you manage related records directly on a resource's view or edit page.
Creating a Relation Manager
bash
The command asks for the panel, the resource and the relationship. You can also pass them as arguments:
bash
This creates app/Laravilt/Admin/Resources/Category/RelationManagers/ProductsRelationManager.php.
Basic Structure
php
Registering in the Resource
php
Properties & Methods
| Member | Description |
|---|---|
$relationship | Eloquent relationship name on the owner model |
$recordTitleAttribute | Attribute used as the record title |
$label / $pluralLabel | Singular and plural labels |
$icon | Lucide icon |
isReadOnly() | Return true to disable create/edit/delete |
canCreate(), canEdit(), canDelete() | Per-operation checks |
getHeaderActions() | Actions above the relation table |
Related
- Nested Resources: full child resources with their own pages