Download the PHP package dandoetech/laravel-resource-registry without Composer
On this page you can find all versions of the php package dandoetech/laravel-resource-registry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dandoetech/laravel-resource-registry
More information about dandoetech/laravel-resource-registry
Files in dandoetech/laravel-resource-registry
Package laravel-resource-registry
Short Description Laravel bridge for DanDoeTech Resource Registry: ClassBasedDriver, capability interfaces, computed resolvers, ServiceProvider.
License MIT
Homepage https://github.com/dandoetech/laravel-resource-registry
Informations about the package laravel-resource-registry
Laravel Resource Registry
Pre-release — Architecture by senior tech lead, implementation largely AI-assisted with human review. Not fully reviewed. Architecture may change before v1.0.0.
Laravel bridge for the DanDoeTech Resource Registry. Auto-discovers Resource classes, binds the Registry as a singleton, and provides capability interfaces for Eloquent integration.
This is the central package — install it first, then add consumer packages as needed.
Installation
The service provider is auto-discovered. Publish the config:
Quick Start
1. Define a Resource
Create a Resource class in app/Resources/:
2. Use the Registry
The Registry is bound as a singleton. Inject or resolve it anywhere:
Resources are auto-discovered from configured paths on first access.
Configuration
config/ddt_registry.php:
Note: The API route prefix is configured in
config/ddt_api.php(fromlaravel-generic-api), not here. This config only controls resource discovery.
Glob patterns are supported — Modules/*/Resources discovers resources across all module directories.
Related Packages
This package provides the registry and resource scanning. For a complete setup, you'll also need:
| Package | Purpose |
|---|---|
laravel-generic-api |
CRUD endpoints (GET/POST/PATCH/DELETE) for all registered resources |
laravel-model-meta |
Generate Eloquent Models + Migrations from registry definitions |
laravel-openapi-generator |
Auto-generate OpenAPI 3.1 spec from registry |
laravel-bff |
Frontend metadata endpoints (fields, forms, tables, permissions) |
filament-registry-bridge |
Generate Filament admin panel from registry definitions |
Capability Interfaces
Framework-specific capabilities are opt-in via small interfaces. Implement only what you need:
Bridge packages discover capabilities via instanceof:
Computed Field Resolvers
For resources with computed fields using via syntax, resolvers are built automatically:
| Via syntax | Resolver | Example |
|---|---|---|
relation.field |
RelationFieldResolver (subselect) |
category.name |
count:relation |
RelationCountResolver (withCount) |
count:orders |
pluck:relation.field |
RelationPluckResolver (GROUP_CONCAT) |
pluck:tags.name |
For custom logic, implement EloquentComputedResolverInterface:
Reference it in your resource:
API Overview
| Class | Purpose |
|---|---|
DdtServiceProvider |
Binds Registry singleton, publishes config |
ClassBasedDriver |
Scans configured paths for Resource classes |
PathResolver |
Resolves glob patterns to PHP file paths |
HasEloquentModel |
Capability: link resource to Eloquent model |
HasPolicy |
Capability: link resource to Laravel policy |
HasOwnerScope |
Capability: scope queries to authenticated user |
HasScope |
(deprecated) Capability: apply query scope |
EloquentComputedResolverInterface |
Contract for custom computed field query logic |
ViaResolverFactory |
Creates resolvers from via syntax strings |
Testing
License
MIT
All versions of laravel-resource-registry with dependencies
illuminate/cache Version ^11.0 || ^12.0
illuminate/config Version ^11.0 || ^12.0
illuminate/database Version ^11.0 || ^12.0
illuminate/support Version ^11.0 || ^12.0
dandoetech/resource-registry Version ^0.1 || ^0.2