Class ShoppingCart not found

Laraship QuestionsCategory: TechnicalClass ShoppingCart not found
Jesse Rovira asked 5 years ago
Env infos: Apache 2.4.27, PHP 7.1.9, Laravel 5.7, MySQL 5.7.19, Windows Pro. I was writing some translations into file Corals\modules\Marketplace\resources\lang\pt-br\labels.php, also creating some new settings to Store at Corals\modules\Marketplace\config\marketplace.php, when I started to figure out error 500, from NOTHING. Before this strange behavior, everything was fine. In laravel.log, the error is similar as below, but claiming for ShoppingCart class, not theme. I have no clue what's going on. I tried clean all cache from storage/framework, no success. PHP ERROR LOG BELOW: [12-Oct-2019 00:35:32 America/Sao_Paulo] PHP Fatal error: Uncaught Error: Class 'Theme' not found in C:\wamp64\www\locabrasil\Corals\core\Theme\ThemeViewFinder.php:102 Stack trace: #0 C:\wamp64\www\locabrasil\vendor\laravel\framework\src\Illuminate\View\Factory.php(402): Corals\Theme\ThemeViewFinder->replaceNamespace('errors', Array) #1 C:\wamp64\www\locabrasil\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(237): Illuminate\View\Factory->replaceNamespace('errors', Array) #2 C:\wamp64\www\locabrasil\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(397): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #3 C:\wamp64\www\locabrasil\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(374): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #4 C:\wamp64\www\locabrasil\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(289): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpExcept in C:\wamp64\www\locabrasil\Corals\core\Theme\ThemeViewFinder.php on line 102
laraship Staff replied 5 years ago

Hello,

Are you sure its the latest log, it’s impossible that log is related to ShoppingCart class,
also, translation cannot be related so we suggest you review changes you made, may some changes made the module disabled.

can you check the modules table and make sure the Marketplace module is enabled

robernet replied 5 years ago

The problem is probably they made a <strong>php artisan migrate:fresh</strong> and deleted all the previous installation. You can solve it like this:

Go to the file theme that fires the error and temporary delete these lines:

<span class="count">{{ \ShoppingCart::countAllInstances() }}</span>
{{ \ShoppingCart::totalAllInstances() }}

After that you will be able to login, BUT, you will need to reinstall all your modules. Once you finish installing them, paste the lines back in.