Z3d0X / filament-fabricator

Block-Based Page Builder Skeleton for your Filament Apps
https://filamentphp.com/plugins/fabricator
MIT License
251 stars 48 forks source link

Builder Blocks are instantiated during registration #141

Open Z3d0X opened 4 months ago

Z3d0X commented 4 months ago

Problem

This getName() method is called during block registration https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/src/PageBlocks/PageBlock.php#L22-L25

https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/src/FilamentFabricatorManager.php#L78

Potential Solution

A potential viable solution might be to Explicitly set a name like in Layouts https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/src/Layouts/Layout.php#L11-L16

make:page-block could auto to generate $name.

This would be a breaking a change, since existing application would need to explicitly set the $name.

Other ideas are welcome

Z3d0X commented 4 months ago

This might also be the root cause of https://github.com/Z3d0X/filament-fabricator/issues/122