Closed elopezmo closed 9 months ago
I believe is it is eagerly loaded (last addressed in https://github.com/Z3d0X/filament-fabricator/pull/56). Nevertheless I tried your reproduction steps, I'm unable to reproduce the error. Could you please provide with a reproduction repository, so i could investigate this issue further?
Description
A common practice in laravel applications is to have Model::shouldBeStrict() checks active in non-prod environments: https://laravel.com/docs/10.x/eloquent#configuring-eloquent-strictness. Currently, when strict mode is activated, a LazyLoadingViolationException is thrown in: Z3d0X\FilamentFabricator\FilamentFabricatorManager::setPageUrl() in the line
if (filled($page->children))
when attempting to save a SubPage (a page with parent) from the filament admin panel.Reproduction steps
Model::shouldBeStrict();
to the boot() function of the AppServiceProvider.phpFurther comments:
The error does not happen if the line
if (filled($page->children))
is replaced withif ($page->children()->count() > 0 && filled($page->children))
, which seems to suggest that the Violation is not - strictly speaking - a lazy loading violation, but a missing attribute call violation.