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:
- Subscribe to a plan
- Cancel that plan
- Subscribe to the same plan as done in step 1
- 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
.