We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This getName() method is called during block registration
getName()
filament-fabricator/src/PageBlocks/PageBlock.php
Lines 22 to 25 in 50f0cc6
filament-fabricator/src/FilamentFabricatorManager.php
Line 78 in 50f0cc6
A potential viable solution might be to Explicitly set a name like in Layouts
filament-fabricator/src/Layouts/Layout.php
Lines 11 to 16 in 50f0cc6
make:page-block could auto to generate $name.
make:page-block
$name
This would be a breaking a change, since existing application would need to explicitly set the $name.
Other ideas are welcome
The text was updated successfully, but these errors were encountered:
This might also be the root cause of #122
Sorry, something went wrong.
In one of my personal projects I use the following as my base class for blocks:
// [...] namespace App\Filament\Fabricator; // [...] abstract class PageBlock extends \Z3d0X\FilamentFabricator\PageBlocks\PageBlock { public const ID = 'undefined'; public const ICON = 'heroicon-o-plus'; final public static function getBlockSchema(): Block { $block = static::defineBlock( Block::make(static::getBlockId()) ->label(fn () => __('blocks.'.static::getBlockId())) ->icon(static::getBlockIcon()) ); return PageBlockWrapper::wrap($block); } abstract public static function defineBlock(Block $block): Block; public static function mutateData(array $data): array { return $data; } public static function getBlockId(): string { return static::ID; } public static function getBlockIcon(): string { return static::ICON; } #[\Override] public static function getName(): string { return static::getBlockId(); } }
Something similar might be an interesting approach
No branches or pull requests
Problem
This
getName()
method is called during block registrationfilament-fabricator/src/PageBlocks/PageBlock.php
Lines 22 to 25 in 50f0cc6
filament-fabricator/src/FilamentFabricatorManager.php
Line 78 in 50f0cc6
Potential Solution
A potential viable solution might be to Explicitly set a name like in Layouts
filament-fabricator/src/Layouts/Layout.php
Lines 11 to 16 in 50f0cc6
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
The text was updated successfully, but these errors were encountered: