api-platform/core
API Platform Core lets you quickly build hypermedia-driven REST and GraphQL APIs in PHP/Symfony. Supports JSON-LD, Hydra, OpenAPI v2/v3, JSON:API, HAL, and RFC7807. Extensible, high-performance, API-first.
ResourceAccessChecker, HydraSchemaFactory). This makes it viable for Laravel-based TPMs, though some Symfony-centric features (e.g., api_platform_iris route loader) may require workarounds.ApiResource\ResourceInterface, State\ProcessorInterface).api_platform.json configuration or GraphQL middleware.casts(), relations()) may need custom metadata providers or filter decorators.api-platform/graphql bundle), but the core package provides shared utilities (e.g., ObjectMapper, State processing).| Risk Area | Severity | Mitigation |
|---|---|---|
| Laravel-Symfony Abstraction | High | Use Symfony’s HttpKernel as a bridge or abstract container services. |
| Performance Overhead | Medium | Profile serialization/denormalization paths; disable caching if needed. |
| Doctrine/Eloquent Conflicts | Medium | Prefer Doctrine ORM for consistency; use custom metadata providers. |
| GraphQL Complexity | High | Start with REST-only, then incrementally add GraphQL. |
| State Management | Medium | Test custom State\Processor implementations early. |
| Hydra/OpenAPI Generation | Low | Validate schemas with Swagger UI/Redoc during development. |
HttpKernel as a micro-framework or Laravel’s Bridge for shared services.api_platform_iris) may require rewrites.Phase 1: REST API Skeleton
api-platform/core + api-platform/doctrine (for Doctrine).api_platform.json for basic resources (entities with @ApiResource).HttpKernel (if Laravel is the base).ServiceProvider to bind API Platform services manually.Phase 2: Customization
DateFilter, SearchFilter) via decorators.ResourceAccessChecker).Phase 3: GraphQL (Optional)
api-platform/graphql bundle.Phase 4: Optimization
@ApiProperty(serializeAs="...")).| Component | Compatibility | Workaround |
|---|---|---|
| Laravel Eloquent | Partial (requires fixes) | Use custom metadata providers or Doctrine ORM. |
| Symfony Security | High | Bind Symfony’s Security component to Laravel’s container. |
| Doctrine ORM/ODM | High | Prefer ORM for consistency. |
| GraphQL | Medium (requires bundle) | Start with REST; add GraphQL later. |
| OpenAPI/Hydra | High | Validate with Swagger UI. |
| Mercure | Low (experimental) | Use Symfony Mercure bundle if needed. |
@ApiResource.Create, Update).@Assert or custom constraints.DateFilter, SearchFilter).Security or Laravel’s Sanctum.@ApiProperty(security="is_granted('ROLE_ADMIN')") for granular access.DQL, QueryBuilder).api-platform/graphql bundle.State, ObjectMapper) simplify cross-cutting concerns.composer.lock to pin versions.api-platform-filters).HttpKernel) provides deep request insights.How can I help you explore Laravel packages today?