Open yolanmees opened 1 month ago
Modification of the FilamentFabricatorServiceProvider.php The FilamentFabricatorServiceProvider.php file underwent some changes to enhance the overall application function.
Inclusion of a new condition A new condition was integrated into the application operations. It's designed to confirm if the application is not executing in console mode. This ensures that certain parts of the code are only run when necessary, increasing efficiency.
Adjustment of code block structure A portion of the code block, which involves the act of registering a route bind and certain components, has been moved to come under the new condition. This alteration aims to streamline operations and ensure that these actions only occur when appropriate, fostering optimized application performance.
You're absolutely right. Incorporating the Page Model into any Fabricator Block can lead to failure during a fresh installation because of the absence of the pages table, which cannot be executed due to the Service Provider limitation.
It's unclear whether this fix has been thoroughly tested, but addressing it would be beneficial as it can create complications when initiating a new project with pre-existing blocks.
Hello,
I've encountered an issue with this package, related to using models directly within Block files. The problem arises when these models are loaded from a ServiceProvider. This becomes evident during a fresh migration process, where the error "table not exists" is thrown because the system attempts to access the table while it is being migrated.
To address this issue, I've made modifications to the
FilamentFabricatorServiceProvider
. My approach involves wrapping certain parts of the service provider logic within anif
statement that checks if the application is running in console mode. This ensures that the code within the block doesn't execute when commands are running, thereby preventing the Block files from being called prematurely.Here's the change I've implemented:
With this adjustment, the service provider skips this code when Laravel commands are executed, effectively resolving the migration error without impacting the operational functionality of the package.
I hope this fix can be helpful for others facing the same issue and I believe it could be a valuable addition to the package.
Best regards, Yolan Mees