### Install Dependencies and Set Up Testing Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/3.community/2.contributing.md Clone the repository, install Composer and npm dependencies, set up the testing environment, and run initial tests to verify the setup. ```bash git clone https://github.com/YOUR_USERNAME/custom-fields.git cd custom-fields composer install npm install cp phpunit.xml.dist phpunit.xml composer test ``` -------------------------------- ### Complete Plugin Setup Example Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Example of setting up the Custom Fields Plugin within a Filament PanelProvider. This includes registering the plugin with various configurations. ```php id('admin') ->path('admin') ->login() ->colors([ 'primary' => Color::Amber, ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->pages([ Pages\Dashboard::class, ]) ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') ->widgets([ Widgets\AccountWidget::class, ]) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, VerifyCsrfToken::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, ]) ->authMiddleware([ Authenticate::class, ]) ->plugins([ CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ->dateDisplayFormat('m/d/Y') ->dateTimeDisplayFormat('m/d/Y h:i A') ->registerFieldTypes([ 'App\\FieldTypes\\GeoLocation', ]), ]); } } ``` -------------------------------- ### Install Custom Fields Migrations Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/README.md Installs the necessary database migrations for the custom fields package. Run this command after installing the package to set up the required database tables. ```bash php artisan custom-fields:install ``` -------------------------------- ### VisibilityMode Example Usage Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/enums.md Example showing how to configure visibility conditions for a field, setting the mode to 'SHOW' and defining specific conditions. ```php $field->visibility_conditions = [ 'mode' => VisibilityMode::SHOW->value, 'logic' => VisibilityLogic::AND->value, 'conditions' => [ [ 'field' => 'country', 'operator' => VisibilityOperator::IS_NOT_EMPTY->value, ] ] ]; ``` -------------------------------- ### Custom Currency Configuration Example Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Example of overriding the default currency list with specific currency codes and their display names. ```php 'currency' => [ 'default_code' => 'USD', 'currencies' => [ 'USD' => 'US Dollar', 'EUR' => 'Euro', 'GBP' => 'British Pound', 'CAD' => 'Canadian Dollar', ], ], ``` -------------------------------- ### Complete Configuration Example Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md This example shows the full configuration for the custom fields package, including entity discovery, field type settings, feature flags, management interface options, and database table names. ```php // config/custom-fields.php use Relaticle\CustomFields\EntitySystem\EntityConfigurator; use Relaticle\CustomFields\Enums\CustomFieldsFeature; use Relaticle\CustomFields\FeatureSystem\FeatureConfigurator; use Relaticle\CustomFields\FieldTypeSystem\FieldTypeConfigurator; return [ 'entity_configuration' => EntityConfigurator::configure() ->discover([ app_path('Models'), ]) ->cache(enabled: false, ttl: 3600), 'field_type_configuration' => FieldTypeConfigurator::configure() ->enabled([]) ->disabled([]) ->discover(true) ->cache(enabled: false, ttl: 3400), 'features' => FeatureConfigurator::configure() ->enable( CustomFieldsFeature::FIELD_CONDITIONAL_VISIBILITY, CustomFieldsFeature::FIELD_ENCRYPTION, CustomFieldsFeature::FIELD_OPTION_COLORS, CustomFieldsFeature::UI_TABLE_COLUMNS, CustomFieldsFeature::UI_TOGGLEABLE_COLUMNS, CustomFieldsFeature::UI_TABLE_FILTERS, CustomFieldsFeature::FIELD_DESCRIPTION, CustomFieldsFeature::UI_FIELD_WIDTH_CONTROL, CustomFieldsFeature::SYSTEM_MANAGEMENT_INTERFACE, CustomFieldsFeature::SYSTEM_SECTIONS, ) ->disable( CustomFieldsFeature::SYSTEM_MULTI_TENANCY, ), 'management' => [ 'slug' => 'custom-fields', 'navigation_sort' => -1, 'navigation_group' => true, 'cluster' => null, ], 'fields' => [ 'description_max_length' => 255, ], 'sections' => [ 'description_max_length' => 255, ], 'currency' => [ 'default_code' => env('CUSTOM_FIELDS_DEFAULT_CURRENCY', 'USD'), 'currencies' => null, ], 'database' => [ 'migrations_path' => database_path('custom-fields'), 'table_names' => [ 'custom_field_sections' => 'custom_field_sections', 'custom_fields' => 'custom_fields', 'custom_field_values' => 'custom_field_values', 'custom_field_options' => 'custom_field_options', ], 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', ], ], ]; ``` -------------------------------- ### Install Custom Fields v3 Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/3.upgrade-guide.md Install the latest version of the Custom Fields package and run migrations and the upgrade command. ```bash composer require relaticle/custom-fields:"^3.0" -W php artisan migrate php artisan custom-fields:upgrade ``` -------------------------------- ### Install Custom Fields Package Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/1.installation.md Install the Relaticle Custom Fields package using Composer. You will be prompted for authentication using your email and license key. ```bash composer require relaticle/custom-fields:^3.0 ``` -------------------------------- ### Example: Currency Field with Import Formatting Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/3.field-types.md This example shows a Currency field that strips non-numeric characters during import and rounds the value to two decimal places. ```php return FieldSchema::float() ->key('currency') ->importExample('99.99') ->importTransformer(function (mixed $state): ?float { if (blank($state)) { return null; } if (is_string($state)) { $state = preg_replace('/[^0-9.-]/', '', $state); } return round(floatval($state), 2); }); ``` -------------------------------- ### Example: Email Field with Multi-Value and Unique Constraints Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/3.field-types.md This example demonstrates configuring an Email field to support multiple unique email addresses, with per-item validation rules applied. ```php return FieldSchema::multiChoice() ->key('email') ->supportsMultiValue() ->supportsUniqueConstraint() ->withArbitraryValues() ->withoutUserOptions() ->defaultItemValidationRules(['email', 'max:254']); ``` -------------------------------- ### Publish and Run Custom Fields Migrations Source: https://github.com/relaticle/custom-fields/blob/3.x/resources/boost/skills/custom-fields-development/SKILL.md After installing the package, publish the migration files and then run the database migrations to create the necessary tables for custom fields. ```bash php artisan vendor:publish --tag=custom-fields-migrations php artisan migrate ``` -------------------------------- ### FieldDataType Example Usage Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/enums.md Example demonstrating how to check if a field's data type is a choice field. ```php $field = CustomField::first(); if ($field->typeData->dataType->isChoiceField()) { // Render options UI } ``` -------------------------------- ### Install CustomFieldsPlugin Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Register the CustomFieldsPlugin in your Filament panel provider by calling `CustomFieldsPlugin::make()` within the `panel()` method. ```php use Relaticle\CustomFields\CustomFieldsPlugin; use Filament\Panel; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ->id('admin') ->path('admin') ->plugins([ CustomFieldsPlugin::make(), ]); } } ``` -------------------------------- ### Create Multiple Custom Fields for Customer Model Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/4.preset-custom-fields.md A comprehensive example demonstrating the creation of various custom fields (link, select, toggle) for a Customer model, including defining sections and settings. ```php migrator->new( model: Customer::class, fieldData: new CustomFieldData( name: 'Company Website', code: 'company_website', type: 'link', section: new CustomFieldSectionData( name: 'Company Info', code: 'company_info', type: CustomFieldSectionType::SECTION, ), systemDefined: true, width: CustomFieldWidth::_50, ) )->create(); // Choice field with options $this->migrator->new( model: Customer::class, fieldData: new CustomFieldData( name: 'Customer Type', code: 'customer_type', type: 'select', section: new CustomFieldSectionData( name: 'Company Info', code: 'company_info', type: CustomFieldSectionType::SECTION, ), systemDefined: true, width: CustomFieldWidth::_50, ) ) ->options([ 'individual' => 'Individual', 'small_business' => 'Small Business', 'enterprise' => 'Enterprise' ]) ->create(); // Boolean field $this->migrator->new( model: Customer::class, fieldData: new CustomFieldData( name: 'VIP Customer', code: 'is_vip', type: 'toggle', section: new CustomFieldSectionData( name: 'Status', code: 'status', type: CustomFieldSectionType::SECTION, ), systemDefined: true, width: CustomFieldWidth::_25, settings: new CustomFieldSettingsData( list_toggleable_hidden: false ) ) )->create(); } }; ``` -------------------------------- ### Import Column Alias Generation Example Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/importer-exporter-builders.md Illustrates how import columns automatically generate aliases for fuzzy matching, including variations in casing and formatting, to match column headers effectively. ```php // For a field with code="job_title" and name="Job Title": // Generated guesses: ['job_title', 'job title', 'jobtitle', 'Job Title', 'custom_fields_job_title'] // The importer will match the column header against these aliases // regardless of casing or formatting differences ``` -------------------------------- ### Make CustomFieldsPlugin Instance with Authorization Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Create a new plugin instance and define authorization logic using the `authorize()` method. This example restricts access to administrators. ```php CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ``` -------------------------------- ### Example Usage of MissingRecordTitleAttributeException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Demonstrates how to catch the MissingRecordTitleAttributeException when rendering a lookup field for an entity that may not have a primary attribute configured. ```php use Relaticle\CustomFields\Exceptions\MissingRecordTitleAttributeException; try { // Rendering a lookup field for Category $field = CustomField::where('code', 'category') ->where('type', 'record') ->first(); // If Category entity doesn't have primaryAttribute configured, // this will throw when trying to display the lookup value } catch (MissingRecordTitleAttributeException $e) { // Handle missing configuration } ``` -------------------------------- ### Common Tenant Resolver Patterns Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/1.configuration.md Examples of common patterns for resolving tenant IDs, including auth-based, header-based (APIs), and session-based approaches. ```php // Auth-based tenancy CustomFields::resolveTenantUsing(fn() => auth()->user()?->company_id); // Header-based (APIs) CustomFields::resolveTenantUsing(fn() => request()->header('X-Tenant-ID')); // Session-based CustomFields::resolveTenantUsing(fn() => session('current_tenant_id')); ``` -------------------------------- ### Add Private Composer Repository Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/1.installation.md Add the private Composer repository to your project's composer.json file to enable package installation. ```json { "repositories": [ { "type": "composer", "url": "https://satis.relaticle.com" } ] } ``` -------------------------------- ### Implement a Custom Field Type Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/3.community/2.contributing.md Example structure for implementing a new custom field type by adhering to the FieldTypeDefinitionInterface and including necessary components and tests. ```php namespace Relaticle\CustomFields\FieldTypes; use Relaticle\CustomFields\CustomField; use Filament\Forms\Components\Field; use Filament\Tables\Columns\Column; class PhoneFieldType implements FieldTypeDefinitionInterface { public function getFormComponent(CustomField $field): Field { // Implementation } public function getTableColumn(CustomField $field): Column { // Implementation } // ... other required methods } ``` -------------------------------- ### Get Infolist Entries as Collection Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Retrieve infolist entries as a flat collection. An optional model can be provided to override the previously set model. ```php $entries = CustomFields::infolist() ->forModel($post) ->values(); foreach ($entries as $entry) { // Work with individual infolist entries } ``` -------------------------------- ### Get All Registered Entities Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Retrieve a collection of all currently registered entity configurations. Useful for iterating through or inspecting all managed entities. ```php $entities = Entities::getEntities(); foreach ($entities as $entity) { echo $entity->labelPlural; } ``` -------------------------------- ### Example Usage of CustomFieldAlreadyExistsException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Demonstrates how to catch CustomFieldAlreadyExistsException when attempting to create a custom field with a code that already exists. It shows the try-catch block and the expected exception message format. ```php use Relaticle\CustomFields\Exceptions\CustomFieldAlreadyExistsException; try { CustomField::create([ 'name' => 'Email', 'code' => 'email', 'type' => 'email', 'entity_type' => Post::class, ]); // This will throw if 'email' already exists for Post CustomField::create([ 'name' => 'Email Address', 'code' => 'email', 'type' => 'email', 'entity_type' => Post::class, ]); } catch (CustomFieldAlreadyExistsException $e) { // Handle: "Could not create custom field `email` because it already exists" } ``` -------------------------------- ### Example Usage of CustomFieldDoesNotExistException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Demonstrates catching CustomFieldDoesNotExistException when attempting to access or delete a non-existent custom field. It shows separate try-catch blocks for retrieval and deletion operations. ```php use Relaticle\CustomFields\Exceptions\CustomFieldDoesNotExistException; try { $field = CustomField::where('code', 'nonexistent')->firstOrFail(); } catch (CustomFieldDoesNotExistException $e) { // Handle: "Could not get custom field `nonexistent` because it does not exist" } try { CustomField::whereCode('nonexistent')->delete(); } catch (CustomFieldDoesNotExistException $e) { // Handle: "Could not delete custom field `nonexistent` because it does not exist" } ``` -------------------------------- ### Filament Plugin Configuration Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Integrate the CustomFieldsPlugin into your Filament panel. This example shows how to set authorization, date/time display formats, and register custom field types. ```php use Relaticle\CustomFields\CustomFieldsPlugin; use Filament\Panel; public function panel(Panel $panel): Panel { return $panel ->plugins([ CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ->dateDisplayFormat('m/d/Y') ->dateTimeDisplayFormat('m/d/Y h:i A') ->registerFieldTypes([ 'App\\FieldTypes\\CustomType1', ]), ]); } ``` -------------------------------- ### Get Infolist Builder for Custom Fields Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Obtain an infolist builder for displaying custom fields in Filament infolists. This allows you to present custom field values in a structured view. ```php use Relaticle\CustomFields\Facades\CustomFields; $entries = CustomFields::infolist() ->forModel($record) ->values(); ``` -------------------------------- ### Configure Date Display Format Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Set a custom display format for all date custom fields using the `dateDisplayFormat()` method. This example sets the format to 'm/d/Y'. ```php CustomFieldsPlugin::make() ->dateDisplayFormat('m/d/Y') // US format ``` -------------------------------- ### Instantiate InfolistBuilder Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Create an instance of the InfolistBuilder using the facade. No parameters are required for the constructor. ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::infolist(); ``` -------------------------------- ### Filament Plugin Configuration Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Configure the CustomFieldsPlugin within your Filament panel. This example demonstrates how to set authorization, date/time display formats, and register custom field types. ```php // In Filament panel configuration use Relaticle\CustomFields\CustomFieldsPlugin; use Filament\Panel; public function panel(Panel $panel): Panel { return $panel ->id('admin') ->path('admin') ->plugins([ CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ->dateDisplayFormat('m/d/Y') ->dateTimeDisplayFormat('m/d/Y h:i A') ->registerFieldTypes([ 'App\\FieldTypes\\GeoLocation', ]), ]); } ``` -------------------------------- ### Get Lookup Source Entities as Options Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Generate an array of key-value pairs specifically for lookup source entities, useful for populating select inputs. This method can use plural labels based on the provided parameter. ```php static array getLookupOptions(bool $usePlural = true): array ``` ```php $lookupOptions = Entities::getLookupOptions(); // Returns: ['App\Models\Category' => 'Categories', 'App\Models\Tag' => 'Tags'] ``` -------------------------------- ### Define Form Component using a Closure Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/3.field-types.md Use a closure to create and configure a custom form component, allowing for dynamic setup based on the custom field's properties. ```php ->formComponent(function (CustomField $customField) { return TextInput::make($customField->getFieldName()) ->label($customField->name) ->maxLength(255); }) ``` -------------------------------- ### Preview Upgrade Changes Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/3.upgrade-guide.md Use the --dry-run option to see what changes the upgrade command would make without applying them. ```bash php artisan custom-fields:upgrade --dry-run ``` -------------------------------- ### Get Registered CustomFieldsPlugin Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Retrieve the currently registered plugin instance using the static `get()` method. This is useful for accessing plugin methods like `isAuthorized()`. ```php $plugin = CustomFieldsPlugin::get(); $authorized = $plugin->isAuthorized(); ``` -------------------------------- ### Import Facades and Base Classes Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-type-facade.md Import necessary classes for working with custom fields, including the facade, base field type, and schema builder. ```php use Relaticle\CustomFields\Facades\CustomFieldsType; use Relaticle\CustomFields\FieldTypeSystem\BaseFieldType; use Relaticle\CustomFields\FieldTypeSystem\FieldSchema; ``` -------------------------------- ### Get Custom Field Value Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/README.md Retrieve the value of a specific custom field for a given model instance. This involves fetching the custom field definition and then using the model's method to get the value. ```php $post = Post::find(1); $field = CustomField::where('code', 'author_name')->first(); $value = $post->getCustomFieldValue($field); ``` -------------------------------- ### Infolist Builder Imports Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Import necessary classes for using the InfolistBuilder and CustomFields facade. ```php use Relaticle\CustomFields\Filament\Integration\Builders\InfolistBuilder; use Relaticle\CustomFields\Facades\CustomFields; ``` -------------------------------- ### Define CustomFieldDoesNotExistException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Defines the CustomFieldDoesNotExistException class, extending the base Exception. It includes static factory methods for various operations like updating, deleting, activating, getting, and getting options for non-existent custom fields. ```php namespace Relaticle\CustomFields\Exceptions; class CustomFieldDoesNotExistException extends Exception { public static function whenUpdating(string $code): self public static function whenDeleting(string $code): self public static function whenActivating(string $code): self public static function whenGetting(string $code): self public static function whenGettingOptions(string $code): self } ``` -------------------------------- ### Get Custom Field Section Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves the section to which a custom field belongs, if any. This uses a `BelongsTo` relationship. ```php public function section(): BelongsTo ``` ```php $section = $field->section; ``` -------------------------------- ### Run Migrations Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/3.upgrade-guide.md Execute pending database migrations after updating the package dependencies. ```bash php artisan migrate ``` -------------------------------- ### Instantiate TableBuilder Facade Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/table-builder.md Create an instance of the TableBuilder using the CustomFields facade. No parameters are required for the constructor. ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::table(); ``` -------------------------------- ### customFieldModel() Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Get the name of the custom field model class. This is useful for referencing the model in other parts of the application. ```APIDOC ## customFieldModel() ### Description Get the name of the custom field model class. ### Method `static` ### Returns `class-string` — The fully qualified class name of the CustomField model. ### Example ```php $modelClass = CustomFields::customFieldModel(); // Returns: 'Relaticle\CustomFields\Models\CustomField' ``` ``` -------------------------------- ### Configure Entity Discovery with Multiple Paths and Caching Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Configure entity discovery from multiple directories and enable caching with a specified Time-To-Live (TTL). This is useful for performance optimization. ```php EntityConfigurator::configure() ->discover([ app_path('Models'), app_path('Domain/Entities'), ]) ->cache(enabled: true, ttl: 3600) ``` -------------------------------- ### Get All Custom Fields for a Model Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves a query builder for all custom fields associated with a specific model instance. ```php public function customFields(): CustomFieldQueryBuilder { ``` -------------------------------- ### Run Tests Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/3.community/2.contributing.md Execute the full test suite, specific test suites (Pest, types), or architecture tests. ```bash # Run all tests composer test # Run specific tests composer test:pest composer test:types ``` ```bash # Run full test suite composer test # Run with coverage composer test-coverage # Run only architecture tests composer test:arch ``` -------------------------------- ### Get CustomFieldSections for a Specific Entity Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all custom field sections configured for a given entity type, such as 'Post'. ```php $postSections = CustomFieldSection::forEntityType(Post::class)->get(); ``` -------------------------------- ### build Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Generates an InfolistContainer with all infolist entries organized into sections based on the configured custom fields. ```APIDOC ## build() ### Description Generates an InfolistContainer with all infolist entries organized into sections based on the configured custom fields. ### Signature ```php public function build(): InfolistContainer ``` ### Returns - `InfolistContainer` - Container with configured infolist entries. ### Example ```php use Relaticle\CustomFields\Facades\CustomFields; use Filament\Infolists\Infolist; public function infolist(Infolist $infolist): Infolist { return $infolist->schema([ CustomFields::infolist() ->forModel($record) ->build(), ]); } ``` ``` -------------------------------- ### Get Polymorphic Valueable Model Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves the polymorphic model instance that the `CustomFieldValue` is attached to. This uses a `MorphTo` relationship. ```php public function valuable(): MorphTo ``` -------------------------------- ### Get Related Custom Field Definition Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves the `CustomField` definition associated with a `CustomFieldValue`. This uses a `BelongsTo` relationship. ```php public function customField(): BelongsTo ``` -------------------------------- ### InfolistBuilder Constructor Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Initializes a new InfolistBuilder instance. Instances are typically accessed via the CustomFields facade. ```APIDOC ## Constructor ### Description Initializes a new InfolistBuilder instance. Instances are typically accessed via the CustomFields facade. ### Signature ```php public function __construct() ``` ### Example ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::infolist(); ``` ``` -------------------------------- ### Get Specific Custom Field Value Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves the value of a single, specific custom field for a given model instance. ```php public function getCustomFieldValue(CustomField $customField): mixed { ``` -------------------------------- ### Get Custom Field Values for a Model Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all custom field values associated with a specific model instance. ```php public function customFieldValues(): MorphMany { ``` -------------------------------- ### Run Custom Fields Migrations (Bash) Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/4.preset-custom-fields.md Commands to execute custom fields migrations using Artisan. Use `--path` to specify the directory or a specific migration file. ```bash php artisan migrate --path=database/custom-fields ``` ```bash php artisan migrate --path=database/custom-fields/2025_08_15_022226_create_general_fields_for_order.php ``` -------------------------------- ### Get Active Custom Fields in a Section Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all active custom fields associated with a specific custom field section. ```php $section = CustomFieldSection::find(1); $fields = $section->fields()->active()->get(); ``` -------------------------------- ### Enable Multi-Tenancy and Resolve Tenant Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/README.md Enable the multi-tenancy feature and register a resolver function to determine the current tenant. ```php // config/custom-fields.php ->enable(CustomFieldsFeature::SYSTEM_MULTI_TENANCY) // Register resolver CustomFields::resolveTenantUsing( fn() => auth()->user()?->company_id ); ``` -------------------------------- ### dateTimeDisplayFormat Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Gets the configured date-time display format. Returns the current format string or null if component defaults are used. ```APIDOC ## dateTimeDisplayFormat() ### Description Get the configured date-time display format. ### Method static ### Returns `?string` - The configured format, or null for component defaults. ``` -------------------------------- ### Local Development Commands Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/3.community/2.contributing.md Commands for local development, including watching frontend assets, formatting code, and running static analysis. ```bash # Watch frontend assets npm run dev # Format code composer lint # Run static analysis composer test:types ``` -------------------------------- ### Configure Entity Discovery and Caching Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/1.configuration.md Optimize performance by configuring entity discovery paths and enabling caching. This reduces the overhead of finding and loading models. ```php 'entity_configuration' => EntityConfigurator::configure() ->discover(app_path('Models')) ->cache(env('CUSTOM_FIELDS_CACHE', true)), // Enable caching ``` -------------------------------- ### dateDisplayFormat Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Gets the configured date display format. Returns the current format string or null if component defaults are used. ```APIDOC ## dateDisplayFormat() ### Description Get the configured date display format. ### Method static ### Returns `?string` - The configured format, or null for component defaults. ``` -------------------------------- ### valueModel() Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Get the name of the custom field value model class. This is useful for referencing the value model in other parts of the application. ```APIDOC ## valueModel() ### Description Get the name of the custom field value model class. ### Method `static` ### Returns `class-string` — The fully qualified class name of the CustomFieldValue model. ### Example ```php $modelClass = CustomFields::valueModel(); ``` ``` -------------------------------- ### Publish Configuration File Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Publish the custom-fields configuration file to your project. This makes the configuration file available for modification. ```bash php artisan vendor:publish --provider="Relaticle\CustomFields\CustomFieldsServiceProvider" --tag=config ``` -------------------------------- ### Instantiate FormBuilder Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/form-builder.md Create a new FormBuilder instance using the facade. No parameters are required for instantiation. ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::form(); ``` -------------------------------- ### Import Entities Facade Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Import the Entities facade to use its static methods for managing custom fields and entities throughout your application. ```php use Relaticle\CustomFields\Facades\Entities; ``` -------------------------------- ### Get Custom Field Values Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all stored values for a given custom field across all records. This uses a `HasMany` relationship. ```php public function values(): HasMany ``` -------------------------------- ### Create ImporterBuilder Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/importer-exporter-builders.md Instantiate the ImporterBuilder using the CustomFields facade. No parameters are required for the constructor. ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::importer(); ``` -------------------------------- ### Get Active Custom Fields Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves only the custom fields that are currently active. Use this scope when you only need to query active fields. ```php static CustomFieldQueryBuilder active() ``` ```php $fields = CustomField::active()->get(); ``` -------------------------------- ### Build InfolistContainer Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Generate an InfolistContainer with all infolist entries organized into sections. This is typically used within a Filament resource's infolist method. ```php use Relaticle\CustomFields\Facades\CustomFields; use Filament\Infolists\Infolist; public function infolist(Infolist $infolist): { return $infolist->schema([ CustomFields::infolist() ->forModel($record) ->build(), ]); } ``` -------------------------------- ### Example Usage of FieldTypeNotOptionableException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Illustrates how to catch FieldTypeNotOptionableException when trying to add options to a custom field of a type that does not support them, such as a 'text' type field. ```php use Relaticle\CustomFields\Exceptions\FieldTypeNotOptionableException; try { $field = CustomField::find(1); // Type: 'text' $field->options()->create([ 'label' => 'Option 1', 'value' => 'option_1', ]); } catch (FieldTypeNotOptionableException $e) { // Handle: "This field type is not optionable." } ``` -------------------------------- ### CustomFieldsPlugin::make() Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Creates a new instance of the CustomFieldsPlugin. This is the primary way to instantiate the plugin before registering it. ```APIDOC ## CustomFieldsPlugin::make() ### Description Create a new plugin instance. ### Method static make(): static ### Returns `CustomFieldsPlugin` — Plugin instance. ### Example ```php CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ``` ``` -------------------------------- ### Get Active Custom Fields for a Model Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all active custom fields associated with a specific model instance, like a 'Post'. ```php $post = Post::find(1); $fields = $post->customFields()->active()->get(); ``` -------------------------------- ### Get Custom Field Options Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves all options associated with a select, multi-select, radio, or checkbox-list custom field. This uses a `HasMany` relationship. ```php public function options(): HasMany ``` ```php $field = CustomField::find(1); $options = $field->options()->get(); ``` -------------------------------- ### Import CustomFields Facade Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Import the CustomFields facade into your PHP files to use its static methods. ```php use Relaticle\CustomFields\Facades\CustomFields; ``` -------------------------------- ### Create ExporterBuilder Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/importer-exporter-builders.md Instantiate the ExporterBuilder using the CustomFields facade. No parameters are required for the constructor. ```php use Relaticle\CustomFields\Facades\CustomFields; $builder = CustomFields::exporter(); ``` -------------------------------- ### Get Custom Fields by Type Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Filters custom fields to retrieve only those of a specific type. Pass the field type code, such as 'text' or 'email'. ```php static CustomFieldQueryBuilder forType(string $type) ``` ```php $emailFields = CustomField::forType('email')->get(); ``` -------------------------------- ### Define Form, Table, and Infolist Components using Class References Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/3.field-types.md Reference Filament classes directly to define the UI components for form inputs, table columns, and infolist entries for a field. ```php ->formComponent(TextInput::class) ->tableColumn(TextColumn::class) ->infolistEntry(TextEntry::class) ``` -------------------------------- ### Process Custom Field Values with Services Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/services.md Demonstrates a common pattern for processing custom field values within a service class. It shows how to inject and use visibility and value resolver services, and manage tenant context. ```php company_id); $fields = $record->customFields()->get(); $values = []; foreach ($fields as $field) { // Check visibility if (!$this->visibilityService->isFieldVisible($record, $field, $fields)) { continue; } // Resolve value $value = $this->valueResolver->resolve($record, $field); $values[$field->code] = $value; } return $values; } } ``` -------------------------------- ### Get Form Components Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/form-builder.md Retrieve all form field components as a flat Eloquent Collection. This is useful for iterating over components or performing custom operations on them. ```php $components = CustomFields::form() ->forModel($record) ->values(); foreach ($components as $component) { // Work with individual form components } ``` -------------------------------- ### Retrieve All Registered Field Types Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-type-facade.md Get all currently registered custom field types as a `FieldTypeCollection`. This can be used to iterate over and inspect the registered types. ```php use Relaticle\CustomFields\Facades\CustomFieldsType; $fieldTypes = CustomFieldsType::toCollection(); foreach ($fieldTypes as $type) { echo $type->key . ': ' . $type->label; } ``` -------------------------------- ### Skip Specific Upgrade Steps Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/3.upgrade-guide.md Customize the upgrade process by skipping certain steps using the --skip option, providing a comma-separated list of steps to ignore. ```bash php artisan custom-fields:upgrade --skip=clear-caches ``` ```bash php artisan custom-fields:upgrade --skip=email-format,phone-format ``` -------------------------------- ### build() Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/form-builder.md Generates a Filament Grid component containing all form fields, organized into sections by default. ```APIDOC ## build() ### Description Generates a Filament Grid component containing all form fields, organized into sections by default. ### Returns - `Grid` - Filament Grid component with form fields configured. ### Example ```php use Relaticle\CustomFields\Facades\CustomFields; use Filament\Forms\Form; public function form(Form $form): Form { return $form->schema([ CustomFields::form() ->forModel($record) ->build(), ]); } ``` ``` -------------------------------- ### Get Date-Time Display Format Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Retrieves the currently configured display format for date-time custom fields. Returns null if component defaults are being used. ```php static ?string dateTimeDisplayFormat() ``` -------------------------------- ### Enable Multi-Tenancy Feature Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/1.configuration.md Enable the multi-tenancy feature to ensure tenant isolation. Configure the database column name for the tenant foreign key. ```php 'features' => FeatureConfigurator::configure() ->enable( CustomFieldsFeature::SYSTEM_MULTI_TENANCY, // ... other features ), 'database' => [ // ... other config 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', // Your tenant foreign key ], ], ``` -------------------------------- ### Get Date Display Format Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Retrieves the currently configured display format for date custom fields. Returns null if component defaults are being used. ```php static ?string dateDisplayFormat() ``` -------------------------------- ### Create CustomFieldsPlugin Instance Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Instantiate the CustomFieldsPlugin using its static `make()` factory method. ```php CustomFieldsPlugin::make() ``` -------------------------------- ### Get Primary Display Attribute for Model Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/services.md Identifies and returns the name of the primary attribute used for displaying a model instance, typically 'name' or 'title'. ```php use Relaticle\CustomFields\Services\ModelAttributeDiscoveryService; $service = app(ModelAttributeDiscoveryService::class); $displayAttribute = $service->getDisplayAttribute(new Post()); // Returns: 'title' ``` -------------------------------- ### Authorize Custom Fields Access Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/configuration.md Control access to the custom fields management interface using a callback. This example checks if the authenticated user has the 'manage-custom-fields' permission. ```php ->authorize(fn() => auth()->user()?->can('manage-custom-fields')) ``` ```php CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->is_admin) ``` -------------------------------- ### Infolist Entry State Configuration Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/infolist-builder.md Entries are configured with proper state resolution for custom fields. The state is automatically resolved from the custom field values for the given record. ```php // State is automatically resolved from custom field values $entry->state(fn($record) => $record->getCustomFieldValue($field)) ``` -------------------------------- ### Configure Entity Discovery in custom-fields.php Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Set up entity discovery and caching behavior in the `custom-fields.php` configuration file. This allows you to define the paths for entity discovery and control caching. ```php // config/custom-fields.php 'entity_configuration' => EntityConfigurator::configure() ->discover(app_path('Models')) ->cache(false), ``` -------------------------------- ### Register Entity from Array Configuration Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Register an entity using a simple array configuration. This is a convenient way to define entity settings. ```php Entities::registerFromArray([ 'modelClass' => 'App\Models\Post', 'alias' => 'posts', 'labelSingular' => 'Post', 'labelPlural' => 'Posts', 'icon' => 'heroicon-o-document', 'primaryAttribute' => 'id', ]); ``` -------------------------------- ### Get Entities with Custom Fields Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Retrieve all entities that have the CUSTOM_FIELDS feature enabled. Use this when you need to filter or process entities specifically configured for custom fields. ```php static EntityCollection withCustomFields() ``` ```php $entitiesWithFields = Entities::withCustomFields(); ``` -------------------------------- ### Run Upgrade Without Prompts Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/1.getting-started/3.upgrade-guide.md Execute the upgrade command in automated environments like CI/CD pipelines using the --force option to bypass confirmation prompts. ```bash php artisan custom-fields:upgrade --force ``` -------------------------------- ### Set Tenant from Filament Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/services.md Sets the tenant context by extracting it from Filament's current tenant. This is typically called automatically by the Filament plugin in multi-tenant setups. ```php TenantContextService::setFromFilamentTenant(); ``` -------------------------------- ### infolist() Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Returns an infolist builder for displaying custom fields in Filament infolists. This method helps in creating infolist entries that display custom field data. ```APIDOC ## infolist() ### Description Returns an infolist builder for displaying custom fields in Filament infolists. ### Method `static` ### Returns `InfolistBuilder` — A builder for creating infolist entries from custom fields. ### Example ```php use Relaticle\CustomFields\Facades\CustomFields; $entries = CustomFields::infolist() ->forModel($record) ->values(); ``` ``` -------------------------------- ### Authorize CustomFields Access with Policy Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-plugin.md Configure access control for the custom fields interface by providing a policy check to the `authorize()` method. This example uses a 'manage-custom-fields' ability. ```php CustomFieldsPlugin::make() ->authorize(fn() => auth()->user()?->can('manage-custom-fields')) ``` -------------------------------- ### Solution for MissingRecordTitleAttributeException Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/errors.md Shows how to configure an entity with a `primaryAttribute` to resolve the MissingRecordTitleAttributeException. ```php use Relaticle\CustomFields\Facades\Entities; Entities::registerFromArray([ 'modelClass' => 'App\\Models\\Category', 'alias' => 'categories', 'labelSingular' => 'Category', 'labelPlural' => 'Categories', 'primaryAttribute' => 'name', // Add this! ]); ``` -------------------------------- ### Get Custom Fields Visible in Lists Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Retrieves custom fields that are configured to be visible in list views. Use this scope to filter fields for display in tables or lists. ```php static CustomFieldQueryBuilder visibleInList() ``` ```php $fields = CustomField::visibleInList()->get(); ``` -------------------------------- ### Setting Date Display Formats via Plugin Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/1.configuration.md Configure consistent date and date-time display formats across all Filament components using the `CustomFieldsPlugin`. ```php use Relaticle\CustomFields\CustomFieldsPlugin; CustomFieldsPlugin::make() ->dateDisplayFormat('m/d/Y') ->dateTimeDisplayFormat('m/d/Y h:i A') ``` -------------------------------- ### FieldSchema API Configuration Methods Source: https://github.com/relaticle/custom-fields/blob/3.x/docs/content/2.essentials/3.field-types.md These methods allow fluent configuration of a field type's key, label, icon, sorting, and integration with Filament components. ```php ->key('field-key') // Unique field identifier ->label('Field Label') // Display name ->icon('heroicon-o-star') // Icon for field type ->priority(50) // Sort order (lower = first) ->formComponent($component) // Form field component ->tableColumn($column) // Table column component ->tableFilter($filter) // Table filter component ->infolistEntry($entry) // Read-only display component ->withValidationCapabilities(...) ->defaultValidationRules($rules) ->searchable() ->sortable() ->filterable() ->encryptable() ``` -------------------------------- ### sectionModel Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Gets the name of the custom field section model class. This method returns the fully qualified class name of the model used for custom field sections. ```APIDOC ## sectionModel() ### Description Get the name of the custom field section model class. ### Method static ### Returns `class-string` - The fully qualified class name of the CustomFieldSection model. ``` -------------------------------- ### optionModel Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Gets the name of the custom field option model class. This method returns the fully qualified class name of the model used for custom field options. ```APIDOC ## optionModel() ### Description Get the name of the custom field option model class. ### Method static ### Returns `class-string` - The fully qualified class name of the CustomFieldOption model. ``` -------------------------------- ### Discover Entities in Specified Paths Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/entities-facade.md Enable automatic discovery of entities by providing an array of directory paths to scan. Defaults to application paths if empty. ```php // Discover in app/Models directory Entities::discover([app_path('Models')]); // Discover in multiple directories Entities::discover([ app_path('Models'), app_path('Domain/Entities'), ]); ``` -------------------------------- ### Custom Tenant Resolver Source: https://github.com/relaticle/custom-fields/blob/3.x/resources/boost/skills/custom-fields-development/SKILL.md Implement a custom tenant resolver for multi-tenancy outside of Filament panels by defining a closure for `CustomFields::resolveTenantUsing` in `AppServiceProvider::boot()`. ```php use Relaticle\CustomFields\CustomFields; // In AppServiceProvider::boot() CustomFields::resolveTenantUsing(fn () => auth()->user()?->team_id); ``` -------------------------------- ### Configure Entity Discovery Source: https://github.com/relaticle/custom-fields/blob/3.x/resources/boost/skills/custom-fields-development/SKILL.md Set up entity discovery for custom fields by configuring the 'entity_configuration' in `config/custom-fields.php` using `EntityConfigurator`. This allows specifying model paths and exclusions. ```php use Relaticle\CustomFields\EntitySystem\EntityConfigurator; 'entity_configuration' => EntityConfigurator::configure() ->discover(app_path('Models')) ->exclude(['User', 'Team']) ->cache(enabled: true, ttl: 3600), ``` -------------------------------- ### Get Custom Fields for a Specific Entity Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/models.md Filters custom fields to retrieve only those associated with a particular entity type. Pass the fully qualified model class name as a string. ```php static CustomFieldQueryBuilder forEntity(string $model) ``` ```php $postFields = CustomField::forEntity(Post::class)->get(); ``` -------------------------------- ### Get Custom Field Model Class Name Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/custom-fields-facade.md Retrieves the fully qualified class name of the custom field model. This is useful for dynamic model instantiation or type hinting. ```php $modelClass = CustomFields::customFieldModel(); // Returns: 'Relaticle\CustomFields\Models\CustomField' ``` -------------------------------- ### Import and Export Builder Facade Usage Source: https://github.com/relaticle/custom-fields/blob/3.x/_autodocs/api-reference/importer-exporter-builders.md Provides the necessary 'use' statements for utilizing the ImporterBuilder, ExporterBuilder, and CustomFields facade in your PHP code. ```php use Relaticle\CustomFields\Filament\Integration\Builders\ImporterBuilder; use Relaticle\CustomFields\Filament\Integration\Builders\ExporterBuilder; use Relaticle\CustomFields\Facades\CustomFields; ```