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

[Documentation]: Schema Slots Feature #94

Open Z3d0X opened 9 months ago

Z3d0X commented 9 months ago

Note: this feature is implemented just need to be documented

If you add custom columns to Page Model you can use schema slots to add additional fields to the Page Resource Form, without overriding it.

Example:

use Z3d0X\FilamentFabricator\Facades\FilamentFabricator;

// in boot of a service provider
FilamentFabricator::registerSchemaSlot('sidebar.after', [
  TextInput::make('seo_title'),
  Textarea::make('seo_description'),
]);

Available Schema Slots:

Z3d0X commented 4 months ago

Should we deprecate this feature in favor of overriding the resource, for more control?

itamarack commented 4 months ago

Should we deprecate this feature in favor of overriding the resource, for more control?

That would be amazing @Z3d0X. Overriding the Resource would provide more flexibility

Z3d0X commented 4 months ago

@itamarack. it's already possible https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/config/filament-fabricator.php#L38

itamarack commented 4 months ago

@itamarack. it's already possible

https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/config/filament-fabricator.php#L38

I'll just check my installation again. I tried creating a page resource and use it but it keep throwing some sort of error. I'll check again. Thank you @Z3d0X

itamarack commented 4 months ago

@itamarack. it's already possible

https://github.com/Z3d0X/filament-fabricator/blob/50f0cc63d86f327d124f380ebb27057f66fce6b4/config/filament-fabricator.php#L38

@Z3d0X It worked! Thanks a lot!

Z3d0X commented 2 months ago

@Nicolascanala you'd need to create migration and those columns to pages table

Nicolascanala commented 2 months ago

@Nicolascanala you'd need to create migration and those columns to pages table

Thanks! I noticed literally 2 mins after posting this comment lol. Hadn't noticed that I had the migration published. Thanks!