Closed kmaphane closed 1 year ago
Okay, somehow the block changes to the below using the layout component and not the blocks component:
<?php extract(collect($attributes->getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace([':', '.'], ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?> @props(['page'])
Okay this issue really has nothing to do with the package.
Good day,
There is an issue with this package especially if you are dealing with data outside of the normal Fabricator process.
Let me explain:
I am building blocks as usual but some of the blocks just need data from a model. The documentation states you can do something like this:
return ['foo' => 'bar']
Sometimes it works, and sometimes it does not and returns the above error. I wish this could work.
This is a great package idea.
The block:
<?php
namespace App\Filament\Fabricator\PageBlocks\Support;
use App\Models\Support\Donor; use Filament\Forms\Components\Builder\Block; use Filament\Forms\Components\Placeholder; use Z3d0X\FilamentFabricator\PageBlocks\PageBlock;
class SupportDonors extends PageBlock { public static function getBlockSchema(): Block { return Block::make('support.support-donors') ->schema([ Placeholder::make('') ->content('Please manage under support management') ]); }
}
The error:
ErrorException PHP 8.1.10 9.52.6 Undefined array key "data"![image](https://user-images.githubusercontent.com/80934965/233768457-0e8c8c9a-8e47-42da-90ac-7ab86b7762e1.png)