Haven't seen anything like this. Maybe you can create some kind of wrappers for them or create you own Field which will extend Nova's Field and do same for other classes that extend Field like Text, Number and so on.
Dec 13, 2019
3
Level 1
Nova Fields - run a method on all fields
Is there a way to run a method on all fields or to set a default meta attribute an all fields?
For example, I want to set ALL Fields as required (rules('required')) and hidden from index (hideFromIndex()) by default and only overwrite it for specific fields in the nova resource class.
Something like:
Field::boot(function($field){
return $field->rules('required')->hideFromIndex();
});
Please or to participate in this conversation.