Hello !
I'm quite new in Flarum community, and I'm doing an extension to migrate a FluxBB forum to Flarum. (This forum is customized so I can't use the migration tools)
Anyway, I would like to add an API route to trigger the migration from the admin page, and I had this problem :
ReflectionException: Class does not exist in D:\\Documents\\Xampp\\htdocs\\Flarum_Piwigo\\vendor\\illuminate\\container\\Container.php:836 ...
Extend.php
namespace Zacharieg\PiwigoFluxBBToFlarum;
use Zacharieg\PiwigoFluxBBToFlarum as PFBB2F;
use Flarum\Extend;
return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\Routes('api'))
->get('/piwigo-fluxbb-to-flarum/users', 'piwigo-fluxbb-to-flarum.users', PFBB2F\Importers\PiwigoFluxBBImportUsers::class)
->get('/piwigo-fluxbb-to-flarum/posts', 'piwigo-fluxbb-to-flarum.posts', PFBB2F\Importers\PiwigoFluxBBImportPosts::class)
->get('/piwigo-fluxbb-to-flarum/tags', 'piwigo-fluxbb-to-flarum.tags', PFBB2F\Importers\PiwigoFluxBBImportTags::class)
];
composer.json autoload
"autoload": {
"psr-4": {
"Zacharieg\\PiwigoFluxBBToFlarum\\": "src/"
}
}
My class
namespace Zacharieg\PiwigoFluxBBToFlarum\Importers;
use Flarum\Api\Controller\AbstractShowController;
use Psr\Http\Message\ServerRequestInterface as Request;
use Tobscure\JsonApi\Document;
class PiwigoFluxBBImportUsers extends AbstractShowController
{
protected function data(Request $request, Document $document)
{
return true;
}
}
I saw similar post on this forum, but they didn't work for me... Any idea of the problem ?