Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors after running the php please sc:switch-to-database command. #876

Closed
Smoseby opened this issue Jun 13, 2023 · 3 comments · Fixed by #877
Closed

Errors after running the php please sc:switch-to-database command. #876

Smoseby opened this issue Jun 13, 2023 · 3 comments · Fixed by #877

Comments

@Smoseby
Copy link

Smoseby commented Jun 13, 2023

Description

After running the php please sc:switch-to-database command to Swtich to a database, we got the following errors.

   Exception 

  The HasRunwayResource trait is missing from the [DoubleThreeDigital\SimpleCommerce\Customers\CustomerModel] model.

  at vendor/doublethreedigital/runway/src/Runway.php:27
     23▕                     $handle = $config['handle'];
     24▕                 }
     25▕ 
     26▕                 if (! in_array(Traits\HasRunwayResource::class, class_uses_recursive($model))) {
  ➜  27▕                     throw new \Exception(__('The HasRunwayResource trait is missing from the [:model] model.', ['model' => $model]));
     28▕                 }
     29▕ 
     30▕                 if (! isset($config['blueprint'])) {
     31▕                     throw new \Exception(__('The [:model] model is missing a blueprint.', ['model' => $model]));

      +12 vendor frames 

  13  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()


   Exception 

  The HasRunwayResource trait is missing from the [DoubleThreeDigital\SimpleCommerce\Orders\OrderModel] model.

  at vendor/doublethreedigital/runway/src/Runway.php:27
     23▕                     $handle = $config['handle'];
     24▕                 }
     25▕ 
     26▕                 if (! in_array(Traits\HasRunwayResource::class, class_uses_recursive($model))) {
  ➜  27▕                     throw new \Exception(__('The HasRunwayResource trait is missing from the [:model] model.', ['model' => $model]));
     28▕                 }
     29▕ 
     30▕                 if (! isset($config['blueprint'])) {
     31▕                     throw new \Exception(__('The [:model] model is missing a blueprint.', ['model' => $model]));

      +12 vendor frames 

  13  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

We fixed both issues by adding the trait in the vendor package, after this we where able to continue and use simple commerce with a database.

Steps to reproduce

  1. Fresh installation of Statamic and Simple Commerce, running on laravel sail
  2. Create some products, and 1 order
  3. Decided to switch to a database, so we ran the php please sc:switch-to-database command

Environment

Environment
Application Name: Laravel
Laravel Version: 10.13.5
PHP Version: 8.2.7
Composer Version: 2.5.8
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Simple Commerce
Currencies: GBP
Gateways: Dummy
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EloquentCustomerRepository
Repository: Order: DoubleThreeDigital\SimpleCommerce\Orders\EloquentOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\Standard\TaxEngine

Statamic
Addons: 3
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.6.0 PRO

Statamic Addons
doublethreedigital/runway: 5.0.7
doublethreedigital/simple-commerce: 5.1.0
statamic/eloquent-driver: 2.1.0
@duncanmcclean
Copy link
Owner

Thanks for letting me know - I've opened #877 which should be released within the next couple of days.

@github-actions
Copy link

Released as part of v5.2.0.

@Smoseby
Copy link
Author

Smoseby commented Jun 14, 2023

Thanks for the quick response and update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants