laravel-doctrine / orm

A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen

Home Page:http://laraveldoctrine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Using SubstituteBindings in Lumen app shows "Target [Illuminate\Contracts\Routing\Registrar] is not instantiable while building [LaravelDoctrine\ORM\Middleware\SubstituteBindings]"

RobQuistNL opened this issue · comments

Please prefix your issue with one of the following: [BUG] [PROPOSAL] [QUESTION].

Package 1.7.11, Lumen 8.3.4

Expected behaviour

Getting routes with entities in there resolved nicely.

Actual behaviour

When adding the LaravelDoctrine\ORM\Middleware\SubstituteBindings middleware in the routeMiddleware, we get the following error:

Illuminate\Contracts\Container\BindingResolutionException

Target [Illuminate\Contracts\Routing\Registrar] is not instantiable while building [LaravelDoctrine\ORM\Middleware\SubstituteBindings].

When we don't have this middleware, the URL resolves, but receives an uninitialized object;

Typed property App\Models\Location\Building::$id must not be accessed before initialization