orm icon indicating copy to clipboard operation
orm copied to clipboard

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

Open RobQuistNL opened this issue 1 year ago • 0 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

RobQuistNL avatar Apr 03 '23 20:04 RobQuistNL