cybercog / laravel-youtrack-sdk

Laravel wrapper for the YouTrack PHP Software Development Kit provides set of tools to interact with JetBrains YouTrack.
https://komarev.com
MIT License
18 stars 6 forks source link

Error using default installation instructions #5

Closed dbebawy closed 6 years ago

dbebawy commented 6 years ago

Followed steps in readme and received this error: Class Cog\YouTrack\Rest\YouTrackClient does not exist

dbebawy commented 6 years ago

Updated: $youtrack = app(\Cog\YouTrack\Rest\YouTrackClient::class); to: $youtrack = app(\Cog\YouTrack\Rest\Client\YouTrackClient::class); and received error: Target [Cog\Contracts\YouTrack\Rest\HttpClient\HttpClient] is not instantiable while building [Cog\YouTrack\Rest\Client\YouTrackClient].

antonkomarev commented 6 years ago

@dbebawy, thank you for reporting! I haven't updated documentation.

You should bypass contract to application container, not concrete implementation:

$client = app(\Cog\Contracts\YouTrack\Rest\Client\Client::class);

After then instantiated concrete implementation will be returned: \Cog\YouTrack\Rest\Client\YouTrackClient

Instantiated YouTrackClient

Does it help you?

dbebawy commented 6 years ago

Yes, Thank you. I was able to instantiate the client.