Pages · Laravilt
Resource API
Expose a resource as REST API endpoints with generated documentation.
Define an api() method on a resource to expose it as REST endpoints.
Basic API Configuration
php
Endpoints
For a resource with slug categories in the admin panel:
text
Turn individual operations on or off:
php
API Columns
php
ApiResource Methods
| Method | Description |
|---|---|
description() / version() | API documentation metadata |
authenticated() | Require authentication |
columns() | Exposed columns |
allowedFilters() / allowedSorts() / allowedIncludes() | Query capabilities |
paginated() / perPage() | Pagination |
rules() / createRules() / updateRules() | Validation rules |
list(), show(), create(), update(), delete(), bulkDelete() | Enable/disable operations, with optional middleware |
actions() | Custom API actions |
useAPITester() | Show the interactive API tester |
Related
- API Actions: custom endpoints
- Tables API