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

[Documentation]: Schema Slots Feature

Open Z3d0X opened this issue 1 year ago • 7 comments

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:

  • blocks.before
  • blocks.after
  • sidebar.before
  • sidebar.before

Z3d0X avatar Sep 21 '23 16:09 Z3d0X

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

Z3d0X avatar Feb 22 '24 09:02 Z3d0X

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

itamarack avatar Feb 23 '24 20:02 itamarack

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

Z3d0X avatar Feb 23 '24 20:02 Z3d0X

@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 avatar Feb 23 '24 21:02 itamarack

@itamarack. it's already possible

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

@Z3d0X It worked! Thanks a lot!

itamarack avatar Feb 23 '24 21:02 itamarack

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

Z3d0X avatar Apr 08 '24 12:04 Z3d0X

@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!

Nicolascanala avatar Apr 08 '24 12:04 Nicolascanala