krak/api-platform-extra
krak/api-platform-extra adds practical extensions and conveniences for using API Platform with Laravel, helping developers build customizable JSON:API and Hydra APIs faster with framework-friendly integrations and reusable tools.
This release (v0.2.0) changes two things that affect day-to-day use: the Symfony (SF) floor is now 4.4 with 5.x support, and every configuration option is opt-in. Treat it as a deliberate configuration-first upgrade, not a drop-in patch.
composer why symfony/http-foundation (or the relevant SF component) and confirm you are on a supported line.php artisan vendor:publish --tag=<package-config> (check the README for the exact tag), then read every enabled key before touching application code. The config file is now the primary documentation.true, and verify it with a smoke route or Artisan command. Do not enable everything at once; opt-in defaults mean “off” is the safe state, and you want to see each feature switch on cleanly.config/<package>.php, clear config cache, and hit a test route. If nothing happens, that is expected in v0.2.0 — the feature is almost certainly still disabled or cached.Where to look first: the package README’s configuration section, the published config file’s enabled keys, and the package service provider to see which registrations are guarded by those flags.
Explicit flags per environment. Because all configuration is opt-in, use environment variables with false defaults and enable features deliberately in each environment. For example:
// config/<package>.php
'features' => [
'middleware' => env('<PACKAGE>_MIDDLEWARE_ENABLED', false),
'routes' => env('<PACKAGE>_ROUTES_ENABLED', false),
],
This makes local and production behaviour explicit and reviewable in pull requests.
Feature-by-feature rollout. Enable one block, run the test suite, commit, then enable the next. The opt-in model is designed for this. It also makes rollback trivial: flip the flag to false rather than reverting code.
Test setup must enable features. A common failure mode with opt-in config is tests that silently pass because the feature is off. In tests/TestCase.php, enable the specific features each test needs:
protected function setUp(): void
{
parent::setUp();
config([
'<package>.features.middleware' => true,
'<package>.features.routes' => true,
]);
}
Add at least one assertion that proves the feature is active — for example, that the route returns the package’s expected response, not a 404.
Upgrade pattern from v0.1.x. Do not assume your published config matches the new stub. Diff your existing config against the fresh v0.2.0 stub in a scratch directory, then port over only the enabled flags you actually need. Keep the diff in the pull request so reviewers can see which behaviours were switched on intentionally.
Composition and extension. If the package exposes Symfony-based services, bind your own implementations after the package’s service provider registers. Check whether the provider uses register() and boot() conditionally; opt-in flags often guard boot() registrations such as middleware, routes, or view namespaces. Use the package’s documented extension points rather than overriding internals.
Production config discipline. Treat the package config as code: commit it, review it, and cache it. In deployment, run php artisan config:cache after environment variables are set. In local development, run php artisan config:clear whenever you toggle a flag.
php artisan config:clear locally and rebuild the cache in production after flag changes."vendor/package": "0.2.*") and verify the resolved Symfony versions with composer show symfony/http-foundation before deploying.config('<package>') in a temporary route or php artisan tinker; inspect the package’s log channel in storage/logs/laravel.log; and confirm middleware order if the package registers global or group middleware.0.2.*, read the 0.3 release notes before upgrading, and keep a short internal note of which flags your application depends on.How can I help you explore Laravel packages today?