Answer the question
In order to leave comments, you need to log in
Why doesn't it find a class from the library when writing a package (wrapper) for Laravel 5?
Good time!
I'm trying to write a wrapper package for Laravel 5 using the begateway-api-php library.
I created a default structure for packages and set everything up. But in the wrapper class, the original package from the library is not connected .. writes Class not found and I can’t understand why this happens. I ran the 'composer dumpautoload' command cleanly and with the '--optimize' flag - I see that the namespaces were loaded in the autoloader, but the class is still not found.
Here is the structure of the package being created:
Here is the composer.json file from the package:
Here is the original composer.json file of the project where the package is connected:
The package itself is initialized and connected successfully to the project , but as soon as it comes to creating a class from the included librarybegateway/begateway-api-php in the package, an error occurs that the class was not found.
Below is the wrapper class itself, in which the error occurs:
And here is the error itself:
Maybe someone has encountered such a problem and knows how to solve it?
Ready to provide additional information, if needed, to clarify and analyze the problem.
The same problem with another link library, such as Bugherd .
I would be very grateful for advice and help!
Answer the question
In order to leave comments, you need to log in
Did composer pull dependencies? That is, in the vendor folder there is a class in the folder and the folder itself /vendor/begateway/
?
You did not install this package through the composer and dependencies (begateway / begateway-api-php) for it, the program swears at its physical absence
Similarly, if you see that a class is not found - go and see if this class exists :) Your CEP :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question