laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

Router class should implement Registrar Contract #895

Closed Tylerian closed 5 years ago

Tylerian commented 5 years ago

Description:

Laravel\Lumen\Routing\Router even being almost compatible with Illuminate\Contracts\Routing\Registrar, doesn't implement its contract, thus breaking compatibility with lots of Laravel plugins that otherwise would work seamlessly with Lumen too.

Current workarounds

Currently, people are relying on compatibility libraries that wrap the original plugin code and tweaks it to work with Lumen, inevitably duplicating code and breaking update compatibility.

Solutions:

I propose to implement Illuminate\Contracts\Routing\Registrar contract and throw NotSupportedException on the two methods that are incompatible with Lumen's Laravel\Lumen\Routing\Router class.

The sole purpose of this bug report is to ease compatibility between frameworks, as we waste a lot of time writing and updating our compatibility libraries that could otherwise be used writing product code.

driesvints commented 5 years ago

thus breaking compatibility with lots of Laravel plugins

Which ones? We don't support compatibility with any of the Laravel libraries.

The Lumen router is a totally separate implementation than the Laravel one and we have no plans on making these two more compatible with each other.