Hubleto PHP framework fresh install fails with "Cannot redeclare class Hubleto\App\Community\Discussions\Extendibles\AppMenu"

4 weeks ago 27
ARTICLE AD BOX

Using Hubleto 0.25 with PHP 8.1 to 8.5, on Windows (also tested on Linux and Docker, same result), I am trying to create a new app:

Initialize Hubleto:

php hubleto init

Create a new app:

php hubleto create app MyFirstApp

(install app: yes)

Generate a model:

php hubleto create model MyFirstApp MyFirstAppFirstModel

I get this error:

Fatal error: Cannot redeclare class Hubleto\App\Community\Discussions\Extendibles\AppMenu (previously declared in C:\laragon\www\test\vendor\hubleto\erp\apps\Api\Extendibles\AppMenu.php:5) in C:\laragon\www\test\vendor\hubleto\erp\apps\Api\Extendibles\AppMenu.php on line 5 Stack trace: #0 C:\laragon\www\test\vendor\composer\ClassLoader.php(576): include() #1 C:\laragon\www\test\vendor\composer\ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}('C:\\laragon\\www\\...') #2 C:\laragon\www\test\vendor\hubleto\framework\src\DependencyInjection.php(50): Composer\Autoload\ClassLoader->loadClass('Hubleto\\App\\Com...') #3 C:\laragon\www\test\vendor\hubleto\framework\src\Core.php(41): Hubleto\Framework\DependencyInjection::create('Hubleto\\App\\Com...') #4 C:\laragon\www\test\vendor\hubleto\framework\src\App.php(632): Hubleto\Framework\Core->getService('Hubleto\\App\\Com...') #5 C:\laragon\www\test\vendor\hubleto\erp\apps\Desktop\Loader.php(51): Hubleto\Framework\App->collectExtendibles('AppMenu') #6 C:\laragon\www\test\vendor\hubleto\framework\src\AppManager.php(56): Hubleto\App\Community\Desktop\Loader->init() #7 [internal function]: Hubleto\Framework\AppManager->{closure:Hubleto\Framework\AppManager::init():47}(Object(Hubleto\App\Community\Desktop\Loader), 'Hubleto\\App\\Com...') #8 C:\laragon\www\test\vendor\hubleto\framework\src\AppManager.php(47): array_walk(Array, Object(Closure)) #9 C:\laragon\www\test\vendor\hubleto\erp\cli\Agent\Create\Model.php(18): Hubleto\Framework\AppManager->init() #10 C:\laragon\www\test\vendor\hubleto\erp\hubleto(62): Hubleto\Erp\Cli\Agent\Create\Model->run() #11 C:\laragon\www\test\hubleto(10): require_once('C:\\laragon\\www\\...') #12 {main}

How can I resolve this namespace collision so that hubleto create:model works correctly?

Read Entire Article