Repository navigation
CrudResourceMetadata
Pair\Api\CrudResourceMetadata caches normalized CRUD metadata for model classes that expose apiConfig().
It is a small process-local cache used by ApiExposable so repeated calls to getCrudResourceConfig(), getApiConfig(), and helper predicates do not rebuild the same CrudResourceConfig object repeatedly.
Returns the normalized CRUD resource config for a model class.
use Pair\Api\CrudResourceMetadata;
$config = CrudResourceMetadata::configFor(\App\Models\Faq::class);If the class defines apiConfig(), the returned object is built from that config. Otherwise Pair returns conservative CRUD defaults.
Clears cached CRUD metadata.
Invalidate one model class:
CrudResourceMetadata::clear(\App\Models\Faq::class);Invalidate every cached model config:
CrudResourceMetadata::clear();Use explicit invalidation in tests, module generators, or long-running commands that modify model API metadata and keep running in the same PHP process.
- This cache is process-local and starts empty in a fresh PHP process.
- It stores normalized framework metadata, not application data.
- Runtime behavior is defined by PHP code and config arrays, not by comments or docblocks.
See also: ApiExposable, CrudResourceConfig, CrudController.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4