1

I have a custom SiteModule that is used inside scout.php to deliver indexing data to Algolia. I have followed CraftQuest's tutorial on creating a custom SiteModule for handling the indicies.

The setup works when running locally. But when I run it on my host (Hyperlane), I get the error: Class 'modules\sitemodule\services\SiteModuleService' not found

I reference the SiteModule in scout.php thus:

'indices'       => (new \modules\sitemodule\services\SiteModuleService)->getIndicies()

App.php contains:

return [
    '*' => [
        'modules' => [
            'site-module' => [
                'class' => \modules\sitemodule\SiteModule::class,
            ],
        ],
        'bootstrap' => ['site-module'],
    ]
];
  • Composer version (local/prod): 2.0.12
  • PHP version local/prod: 7.3.12/7.3.3

What am I doing wrong?

2

Worked when I added a use-statement to the top of scout.php:

<?php
use modules\sitemodule\services\SitemoduleService as SitemoduleService;

And then:

'indices'       => (new SitemoduleService)->getIndicies()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.