I'm trying to write my own extension for flarum, bu when i following the instructions and trying to write similar to other plugins, I get this error Target class [InnovationCraft\BBCode\Configurator] does not exist Source: https://gitlab.com/innovationcraft/web/forum/bbcodes
Target class [InnovationCraft\BBCode\Configurator] does not exist
Wallseat how did you install your test extension? Via a workbench folder?
You can try re-generating the Composer autoload files with composer dump-autoload (run in the Flarum root)
composer dump-autoload
PS: it says I need to login to see your GitLab link
clarkwinkelmann how did you install your test extension? Via a workbench folder?
add vcs repo to composer.json in flarum folder and composer require
composer require
clarkwinkelmann You can try re-generating the Composer autoload files with composer dump-autoload (run in the Flarum root)
nothing changed
clarkwinkelmann PS: it says I need to login to see your GitLab link
How else can i show it to you?
I'm not able to see your code, but does the class referenced in the error message exists in your extension?
If no such class exists and you were trying to reference one of Flarum's classes, you might just have an incorrect relative PHP import.
clarkwinkelmann So, i pushed it to github, now its public https://github.com/Wallseat/FlarumBBCodes
Wallseat this file needs to be called Configurator.php for Composer auto-loader to find it https://github.com/Wallseat/FlarumBBCodes/blob/master/src/BBCode.php
Configurator.php
EDIT: and it needs to be an invoke-able class to work the way you currently call it with ->configure(::class)
->configure(::class)
Did you copy this from an example somewhere? If the code is simple, you can just use an anonymous callback directly in extend.php
extend.php
clarkwinkelmann this file needs to be called Configurator.php
Thanks. File renaming
clarkwinkelmann EDIT: and it needs to be an invoke-able class to work the way you currently call it with ->configure(::class)
and class reworking solve my problem