aferrandini/disable-bundle
Symfony bundle that adds annotations to disable controllers/actions immediately or within a time window (after/until/range). When disabled, it can show a custom message or redirect the request to another route.
doctrine/annotations), introducing abstraction overhead.App\Http\Middleware\DisableRoutesMiddleware).date_between in Laravel 10+).spatie/laravel-feature-flags).AnnotationReader, EventDispatcher) makes it non-portable without significant refactoring.Annotation system with Laravel’s attributes (PHP 8+) or a lightweight annotation parser.Illuminate\Routing\Router).symfony/annotation) may break in newer PHP versions.laravel-disable-routes) be a better long-term solution?Routing component vs. Laravel’s Illuminate\Routing.AnnotationReader vs. Laravel’s attributes or doctrine/annotations.EventDispatcher vs. Laravel’s events + listeners.rubix/ml-parser).| Step | Action | Tools/Alternatives |
|---|---|---|
| 1 | Assess Feasibility | Evaluate if middleware/database flags can replace the bundle. |
| 2 | Fork & Refactor | If integration is critical, fork the repo and rewrite for Laravel. |
| 3 | Replace Annotations | Convert @Disable to PHP 8 attributes or a custom annotation parser. |
| 4 | Adapt Event System | Replace Symfony events with Laravel’s Event::dispatch(). |
| 5 | Integrate with Router | Create a middleware to check disabled routes before execution. |
| 6 | Test Thoroughly | Verify edge cases (e.g., nested disabled routes, date ranges). |
symfony/http-kernel).storage/ and database/.Redis).| Risk | Impact | Mitigation |
|---|---|---|
| Bundle Fails to Load | Broken routes, 500 errors | Use middleware fallback. |
| Annotation Parsing Errors | Runtime exceptions | Validate annotations at compile time. |
| Symfony Dependency Conflicts | Laravel app crashes | Isolate in a micro-service or fork. |
| Date Logic Bugs | Routes incorrectly disabled | Unit test edge cases (e.g., DST, timezone issues). |
| No Rollback Mechanism | Accidental route disabling | Use database transactions for flag changes. |
AnnotationReader, EventDispatcher) are unfamiliar to most Laravel devs.How can I help you explore Laravel packages today?