laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

Home Page:https://laravel.com/docs/cashier-paddle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query in Subscriber.php will throw a LazyLoadingViolationException if you've prevented lazy loading

joostvanhoof opened this issue · comments

  • Cashier Paddle Version: 1.4.6
  • Laravel Version: 8.62.0
  • PHP Version: 8.0.9
  • Database Driver & Version: MySQL 8

Description:

There is a lazy loaded relationship that will throw a LazyLoadingViolationException if you've prevented lazy loading. Not sure if this is a bug, if not: please feel free to close this.

Steps To Reproduce:

  1. Subscribe to a plan
  2. Cancel that plan
  3. Subscribe to the same plan as done in step 1
  4. Swap plans

The query in Subscriber.php line 533 will throw a LazyLoadingViolationException if you've prevented lazy loading.

Hey @joostvanhoof, yes this is intended. It's not feasible to load the billable up front for every request. You can skip this model/relationship if you want by customizing Model::handleLazyLoadingViolationUsing.