Zod
How can I add fields to / extend a resource from a plugin
Trying it with static:: but no luck unfortunally
class ResourceCompanyResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema(static::getFormSchema())->columns(1);
}
public static function getFormSchema(): array
{
return [
Tabs::make()
->tabs([
Tab::make('Information')
->schema(static::getInformationTabSchema()),
Tab::make('Invoice')
->schema(static::getInvoiceTabSchema()),
Tab::make('Financial')
->schema(static::getFinancialTabSchema())
])
];
}
}
class CompanyResource extends ResourcesCompanyResource
{
public static function getFormSchema(): array
{
return [
Tabs::make()
->tabs([
Tab::make('Information2')
->schema(static::getInformationTabSchema()),
Tab::make('Invoice')
->schema(static::getInvoiceTabSchema()),
Tab::make('Financial')
->schema(static::getFinancialTabSchema())
])
];
}
}
18 replies
How can I add fields to / extend a resource from a plugin
I am not sure what you mean by providing the option by the plugin, is there an option which alows extending?
It's a module/plugin (the resource) we are using in multiple projects. But in one project we need 1 extra field for that resource. So I need to add it in the project but not in the module. So I extended the moduled resource and made the project use the custom one that extended the module. Here I would like to overwrite the form function or add the field.
18 replies