Mar 25, 2019
0
Level 1
Type-hint dependency in controller does not work
Hello, could you help me, pls?
I have created service: OdataService. Then in the controller I can get a service instance like that:
$odata = app(OdataService::class).
But I can not do this just with type-hint in controller method/constructor:
public function __construct(OdataService $odata)
{
//ReflectionException: Class App\Services\OdataService does not exist
}
Lumen 5.8.4, homestead.
Please or to participate in this conversation.