Marketplace installation: Server Error

Laraship QuestionsCategory: TechnicalMarketplace installation: Server Error
tpc asked 3 years ago
Problem when installing the marketplace module:
Corals\Modules\Marketplace\Models\Product::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable::sluggable(): array {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Declaration of Corals\\Modules\\Marketplace\\Models\\Product::sluggable() must be compatible with Cviebrock\\EloquentSluggable\\Sluggable::sluggable(): array at /home/vagrant/CODE/laraship/Corals/modules/Marketplace/Models/Product.php:56)
Attached the log.
Attachments
laraship Staff replied 3 years ago

Hello
Are you using one command installer ?
also can you try running composer update again

tpc replied 3 years ago

No. I am using this guide: https://www.laraship.com/docs/laraship/installation-instructions/installation/
All modules can be installed correctly, only with Marketplace I get this error.
Rerun ‘composer update’ successfully without errors.

$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class…
composer/package-versions-deprecated: …done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover –ansi

Package manifest generated successfully.
127 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Error from laravel logs:
[2021-06-07 10:24:50] local.ERROR: Declaration of Corals\Modules\Marketplace\Models\Product::sluggable() must be compatible with Cviebrock\EloquentSluggable\Sluggable::sluggable(): array {“userId”:1,”exception”:”[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Declaration of Corals\\Modules\\Marketplace\\Models\\Product::sluggable() must be compatible with Cviebrock\\EloquentSluggable\\Sluggable::sluggable(): array at /home/vagrant/CODE/laraship/Corals/modules/Marketplace/Models/Product.php:56)
[stacktrace]
#0 /home/vagrant/CODE/laraship/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(143): Symfony\\Component\\ErrorHandler\\Error\\FatalError->__construct(message: ‘…’, code: ‘…’, error: ‘…’, traceOffset: ‘…’, traceArgs: ‘…’, trace: ‘…’)
#1 /home/vagrant/CODE/laraship/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(130): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->fatalErrorFromPhpError(error: ‘…’, traceOffset: ‘…’)

laraship Staff replied 3 years ago

can you try the one command installer
https://www.laraship.com/docs/laraship/installation-instructions/one-command-installer/

tpc replied 3 years ago

I tried it and the installer *seems* to complete without errors, but all pages (/, /login, /modules) show “500 Sorry, Something went wrong! Back” and I still get the same error in the log.

tech replied 3 years ago

For the moment, the following worked for me: Adding “: array” to the Declaration of Corals\Modules\Marketplace\Models\Product::sluggable() public function according to: https://github.com/Laravel-Backpack/PageManager/issues/111

laraship Staff replied 3 years ago

what is the php version you’re using ?

tech replied 3 years ago

$ php –version
PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:47) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies