Open ssmusoke opened 3 years ago
And about the namespace, the reason I am avoiding it is because this class is aready being used by some people, and I don't want to disrupt something in their projects.
@llagerlof You might add a namespace to your class and use class_alias()
to keep BC.
example:
// in MoodleRest.php
namespace Vendorname\Packagename;
class MoodleRest {
//...
}
class_alias('Vendorname\Packagename\MoodleRest', 'MoodleRest');
Hi Stephen!
I just made a test using Laravel 8 and the framework autoloaded the class correctly.
My steps:
Tha package was added into
composer.json
andcomposer.lock
correctly.web.php
and instantiated the class inside the default route:And it worked.
Did you ran
composer dump-autoload
inside your Laravel project? Sometimes this is necessary to Laravel find the new packages to autoload them.And about the namespace, the reason I am avoiding it is because this class is aready being used by some people, and I don't want to disrupt something in their projects.