You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when it came to getting the service, it was returning NULL $this->user_service = tr_container(\App\Services\UserService::class);
This seems to be because when registering the service, the string provided in config is used as they key in the list, whereas when resolving, the ::class keyword returns the class path without the preceding backslash. Everything works as expected when defining the service without the preceding backslash in config. But I would expect the docs to highlight this, or for there to be a some consistency in key names when registering services.
The text was updated successfully, but these errors were encountered:
In my config/app.php I was registering a service as per the docs
But when it came to getting the service, it was returning NULL
$this->user_service = tr_container(\App\Services\UserService::class);
This seems to be because when registering the service, the string provided in config is used as they key in the list, whereas when resolving, the
::class
keyword returns the class path without the preceding backslash. Everything works as expected when defining the service without the preceding backslash in config. But I would expect the docs to highlight this, or for there to be a some consistency in key names when registering services.The text was updated successfully, but these errors were encountered: