filament-fabricator icon indicating copy to clipboard operation
filament-fabricator copied to clipboard

Builder Blocks are instantiated during registration

Open Z3d0X opened this issue 1 year ago • 2 comments

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 avatar Feb 22 '24 09:02 Z3d0X

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

Z3d0X avatar Feb 22 '24 09:02 Z3d0X