short-edition/framework-extra-bundle
Framework Extra Bundle extends Laravel with practical helpers, traits, and utilities that reduce everyday boilerplate. With simple service provider registration, it drops convenient, reusable features into your app without restructuring existing code, helping you ship faster.
Read this first: this is not a Laravel package. short-edition/framework-extra-bundle is a fork of sensio/framework-extra-bundle, a Symfony bundle that hooks into Symfony's HttpKernel to turn controller attributes/annotations into behavior. It has no service provider, no facade, no Blade/Twig-for-Laravel bridge, and no route integration with Laravel's router. A Laravel developer's realistic day-to-day leverage is zero unless you are maintaining a legacy Symfony app (or a hybrid project with a Symfony component you actually boot). If you are inside a Laravel codebase, do not install it — use the native equivalents below.
Before writing any code, check three things in the repo:
composer.json — the symfony/* and php version constraints. A 0-star fork is usually kept alive for one specific version matrix; mismatches are the #1 install failure.sensio/framework-extra-bundle (last upstream release is ancient and the bundle is effectively abandoned/replaced by Symfony core attributes). Know what the fork actually changed.Configuration/ and Attributes/ (or Configuration/ if it still uses annotations) — this is the entire public surface area: Template, Cache, Security/IsGranted, ParamConverter/Entity, Method, View.Minimal Symfony steps (if you genuinely need it):
composer require short-edition/framework-extra-bundle
// config/bundles.php
return [
// ...
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
];
Then use it on a controller:
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
#[IsGranted('ROLE_USER')]
#[Cache(smaxage: 3600)]
#[Template]
public function show(Product $product): array
{
return ['product' => $product];
}
First useful use case for a Laravel developer is conceptual, not runtime: read the ParamConverter and Template attributes as the direct ancestors of Laravel's route model binding and return view(...). If you are porting patterns from a Symfony codebase into Laravel, map them immediately rather than trying to run the bundle.
Laravel developers should treat this bundle as a pattern dictionary and, in a real Symfony app, keep the attributes thin. Mapping table for daily work:
| Bundle feature | What it does | Laravel equivalent |
|---|---|---|
#[Template] |
Resolves view name from controller/action, returns array as view data | return view('controller.action', $data); invokable controllers |
#[ParamConverter] / #[Entity] |
Doctrine entity resolution into controller args, 404 on miss | Route model binding; explicit Route::bind() in RouteServiceProvider |
#[IsGranted] / #[Security] |
Runtime authorization check via Symfony's security | $this->authorize(...), Gate::authorize, can: middleware |
#[Cache] |
Sets ETag/Last-Modified/s-maxage/expires from attributes |
->middleware('cache.headers:...'), response header helpers |
#[Method] |
Restricts HTTP verbs | Route::get/post/match, ->methods([...]) |
#[View] |
Serialization view layer | API Resources / JsonResource |
Workflow patterns that actually pay off in a Symfony codebase:
#[Security] expressions that duplicate what a voter already does.#[IsGranted] on the action or controller class over ad-hoc checks; treat #[Security] expressions as a last resort because they are strings and invisible to static analysis.#[ParamConverter] works best on typed scalar/entity args where the parameter name matches the route placeholder. For anything else, use an explicit converter or a service call.If you must work on the fork itself: pin a commit, run the upstream test suite against your Symfony version, and keep the diff in Attributes/ or Configuration/ small — those classes are consumed by compiler-pass-driven listeners whose API is not stable across Symfony majors.
ServiceProvider, no Facade, and the entire mechanism is Symfony event listeners (kernel.controller, kernel.view, argument resolvers). Composer-installing it in a Laravel app does nothing except add dead weight.Symfony\Component\Routing\Attribute\Route (5.3+), IsGranted is in Symfony\Component\Security\Http\Attribute\IsGranted (5.2+), and ParamConverter is largely replaced by #[MapEntity] (Symfony\Bridge\Doctrine\Attribute\MapEntity) and #[MapRequestPayload]. Before adopting the bundle, grep your Symfony version for the attribute you need; you may not need the bundle at all.#[Cache] misuse silently serves the wrong content. ETag/Last-Modified are computed from the response; if the response body varies by user, role, or locale, downstream shared caches can leak data. Never annotate authenticated or personalized actions. Debug with the Symfony profiler's Cache panel and bin/console debug:router --show-controllers.ParamConverter misses look like 500s, not 404s. A typo'd entity class or a route param that doesn't match the argument name causes a conversion exception (or no conversion at all under implicit mode). Check sensio_framework_extra.request.auto_convert and the argument name first; use bin/console debug:container --tag=controller.argument_value_resolver.#[Security] is an ExpressionLanguage string. Typos and subject scope errors blow up at request time, not compile time. Prefer #[IsGranted] and real voters.sensio_framework_extra.router.annotations, .security.annotations, .view.annotations, .cache.annotations, and .request.converters toggles are independent — disabling one does not disable siblings. If a feature "doesn't work," check the config key for that specific area before the code.bin/console cache:clear); attribute metadata is cached in the compiled container and stale attributes are a common red herring.ParamConverterInterface and tag the service request.param_converter; add a custom argument value resolver; subscribe to kernel.controller. These are the supported seams — do not monkey-patch the bundle's listeners.WebTestCase hitting each annotated action) — this is the practical equivalent of Laravel feature tests for routes, and it is the only thing that reliably catches broken attribute wiring.How can I help you explore Laravel packages today?