### Development Setup Source: https://custom-fields.relaticle.com/help-support/contributing Steps to clone the repository, install project dependencies using Composer and npm, configure the testing environment, and verify the setup by running tests. ```shell 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 ``` -------------------------------- ### Prepare Eloquent Model for Custom Fields Source: https://custom-fields.relaticle.com/quickstart Ensure your Eloquent model implements the `HasCustomFields` interface and uses the `UsesCustomFields` trait to support custom field storage and retrieval. This allows your model to interact with the custom fields system. ```php use Relaticle\CustomFields\Models\Contracts\HasCustomFields; use Relaticle\CustomFields\Models\Concerns\UsesCustomFields; use Illuminate\Database\Eloquent\Model; class Product extends Model implements HasCustomFields { use UsesCustomFields; // ... your existing model code } ``` -------------------------------- ### Register Custom Fields Plugin in Filament Source: https://custom-fields.relaticle.com/quickstart Register the CustomFieldsPlugin within your Filament panel configuration to enable custom field functionality. This is typically done in the `AdminPanelProvider`. ```php use Relaticle\CustomFields\CustomFieldsPlugin; use Filament\Panel; public function panel(Panel $panel): Panel { return $panel // ... other panel configurations ->plugins([ CustomFieldsPlugin::make(), ]); } ``` -------------------------------- ### Add Custom Fields to Filament Info Lists (PHP) Source: https://custom-fields.relaticle.com/quickstart Integrates custom fields into the info list of a Filament resource's view record page. This involves adding the `CustomFieldsInfolists` component to the `getInfolist` method. It assumes the custom fields are already configured and available. ```php use Relaticle\CustomFields\Filament\Infolists\CustomFieldsInfolists; use Filament\Resources\Pages\ViewRecord; use Filament\Infolists; class ViewProduct extends ViewRecord { // ... public function getInfolist(): array { return [ // ... existing infolist components Infolists\Components\TextEntry::make('name') ->label('Product Name'), Infolists\Components\TextEntry::make('price') ->label('Price'), // Custom Fields CustomFieldsInfolists::make() ->columnSpanFull(), ]; } } ``` -------------------------------- ### Install Filament Custom Fields Source: https://custom-fields.relaticle.com/installation Installs the Filament Custom Fields package using Composer and runs the initial installation artisan command. Requires PHP 8.2+, Laravel 10.0+, and Filament 3.0+. ```Shell composer require relaticle/custom-fields php artisan custom-fields:install ``` -------------------------------- ### Add Custom Fields Component to Filament Form Source: https://custom-fields.relaticle.com/quickstart Integrate the `CustomFieldsComponent` into your Filament resource's form schema to display and manage custom fields. This component handles the rendering and saving of custom field data within the form. ```php use Relaticle\CustomFields\Filament\Forms\Components\CustomFieldsComponent; use Filament\Forms; use Filament\Forms\Form; class ProductResource extends Resource { public static function form(Form $form): Form { return $form ->schema([ // Your existing form fields Forms\Components\TextInput::make('name') ->required(), Forms\Components\TextInput::make('price') ->numeric(), // Add the CustomFieldsComponent CustomFieldsComponent::make(), ]); } // ... } ``` -------------------------------- ### Publish Filament Custom Fields Assets Source: https://custom-fields.relaticle.com/installation Publishes vendor assets for Filament Custom Fields. This includes configuration files, language files, and view files for customization. Use specific tags to publish only the desired assets. ```APIDOC php artisan vendor:publish --tag="custom-fields-config" - Publishes the configuration file for the custom-fields package. php artisan vendor:publish --tag="custom-fields-translations" - Publishes language files for the custom-fields package. php artisan vendor:publish --tag="custom-fields-views" - Publishes view files for the custom-fields package, allowing for customization. ``` -------------------------------- ### Include Custom Fields in Filament Exports (PHP) Source: https://custom-fields.relaticle.com/quickstart Enables the inclusion of custom fields within data exports generated by Filament. This is achieved by extending the `Exporter` class and utilizing the `CustomFieldsExporter::getColumns()` method to dynamically add custom fields as export columns. It requires defining the model and specifying which columns to include. ```php use Filament\Actions\Exports\ExportColumn; use Filament\Actions\Exports\Exporter; use Relaticle\CustomFields\Filament\Exports\CustomFieldsExporter; class ProductExporter extends Exporter { protected static ?string $model = Product::class; public static function getColumns(): array { return [ ExportColumn::make('id') ->label('ID'), ExportColumn::make('name'), ExportColumn::make('price'), // Include custom fields ...CustomFieldsExporter::getColumns(self::getModel()), ]; } } ``` -------------------------------- ### Include Custom Fields in Filament Table Views Source: https://custom-fields.relaticle.com/quickstart Add the `InteractsWithCustomFields` trait to your Filament resource's `ListRecords` page to automatically display custom fields in table columns. This trait enhances the table view to include all defined custom fields. ```php use Relaticle\CustomFields\Filament\Tables\Concerns\InteractsWithCustomFields; use Filament\Resources\Pages\ListRecords; class ListProducts extends ListRecords { use InteractsWithCustomFields; // ... } ``` -------------------------------- ### PHP Field Type Contribution Example Source: https://custom-fields.relaticle.com/help-support/contributing Demonstrates the structure for implementing a new custom field type by extending the `FieldTypeDefinitionInterface` in PHP. It includes essential methods for defining form components and table columns. ```php namespace Relaticle\CustomFields\FieldTypes; use Relaticle\CustomFields\CustomField; use Relaticle\CustomFields\Field; use Relaticle\CustomFields\Column; class PhoneFieldType implements FieldTypeDefinitionInterface { public function getFormComponent(CustomField $field): Field { // Implementation for form component } public function getTableColumn(CustomField $field): Column { // Implementation for table column } // ... other required methods } ``` -------------------------------- ### Restore Custom Field using Relaticle Migration Source: https://custom-fields.relaticle.com/essentials/preset-custom-fields This code example illustrates how to restore a previously deleted preset custom field. It utilizes the `restore()` method within a Relaticle migration, targeting a specific model and field. This is useful for reverting changes or reintroducing fields that were removed. ```php migrator->find(Opportunity::class, 'stage')->restore(); } }; ``` -------------------------------- ### Testing Commands Source: https://custom-fields.relaticle.com/help-support/contributing Provides commands for running the Pest PHP test suite, including options for generating code coverage reports and executing architecture tests. ```shell # Run full test suite composer test # Run with coverage composer test-coverage # Run only architecture tests composer test:arch ``` -------------------------------- ### Development Workflow Commands Source: https://custom-fields.relaticle.com/help-support/contributing Essential commands for local development and maintaining code quality. Includes commands for watching frontend assets, formatting code, and running static type analysis. ```bash # Watch frontend assets npm run dev ``` ```bash # Format code composer lint ``` ```bash # Run static analysis composer test:types ``` -------------------------------- ### Test Your Changes Source: https://custom-fields.relaticle.com/help-support/contributing Executes the project's test suite using Composer scripts. Includes commands to run all tests, specific test types like Pest or types, and tests with coverage. ```shell # Run all tests composer test # Run specific tests composer test:pest composer test:types ``` -------------------------------- ### Access Custom Models via Helper Methods Source: https://custom-fields.relaticle.com/essentials/configuration Retrieve the class names of your registered custom models and create new instances of them using the helper methods provided by the CustomFields facade. This simplifies model instantiation. ```PHP // Get model class names $customFieldClass = CustomFields::customFieldModel(); // Create new instances $customField = CustomFields::newCustomFieldModel(); $value = CustomFields::newValueModel(); $option = CustomFields::newOptionModel(); $section = CustomFields::newSectionModel(); ``` -------------------------------- ### Access Custom Models via Helper Methods Source: https://custom-fields.relaticle.com/essentials Retrieve the class names of your registered custom models and create new instances of them using the helper methods provided by the CustomFields facade. This simplifies model instantiation. ```PHP // Get model class names $customFieldClass = CustomFields::customFieldModel(); // Create new instances $customField = CustomFields::newCustomFieldModel(); $value = CustomFields::newValueModel(); $option = CustomFields::newOptionModel(); $section = CustomFields::newSectionModel(); ``` -------------------------------- ### Deploy Preset Custom Fields Migration Source: https://custom-fields.relaticle.com/essentials/preset-custom-fields This command deploys your custom fields migrations to the database. It uses the standard Laravel Artisan command to run migrations located in a specific directory, ensuring your custom fields are correctly set up in the database. ```shell php artisan migrate --path=database/custom-fields ``` -------------------------------- ### Set Up Product Exporter with Custom Fields Source: https://custom-fields.relaticle.com/essentials/import-export Demonstrates creating a custom Filament exporter for a 'Product' model. It automatically includes all custom fields by utilizing `CustomFieldsExporter::getColumns`, alongside standard model columns. ```PHP namespace App\Filament\Exports; use App\Models\Product; use Filament\Actions\Exports\ExportColumn; use Filament\Actions\Exports\Exporter; use Relaticle\CustomFields\Filament\Exports\CustomFieldsExporter; class ProductExporter extends Exporter { protected static ?string $model = Product::class; // Simply add your columns and spread in the custom fields public static function getColumns(): array { return [ ExportColumn::make('id'), ExportColumn::make('name'), ExportColumn::make('price'), // Add all custom fields automatically ...CustomFieldsExporter::getColumns(self::getModel()), ]; } } ``` -------------------------------- ### Set Up Product Importer with Custom Fields Source: https://custom-fields.relaticle.com/essentials/import-export Demonstrates creating a custom Filament importer for a 'Product' model. It integrates custom fields automatically by extending `CustomFieldsImporter` and filtering data before saving and saving custom field values after the main record is saved. ```PHP namespace App\Filament\Imports; use App\Models\Product; use Filament\Actions\Imports\ImportColumn; use Filament\Actions\Imports\Importer; use Filament\Facades\Filament; use Relaticle\CustomFields\Filament\Imports\CustomFieldsImporter; class ProductImporter extends Importer { protected static ?string $model = Product::class; // Simplest implementation: Add columns in getColumns() public static function getColumns(): array { return [ // Regular columns ImportColumn::make('name')->requiredMapping()->rules(['required']), ImportColumn::make('price')->numeric(), // Add all custom fields automatically ...app(CustomFieldsImporter::class)->getColumns(self::getModel()), ]; } // Before filling model with data, remove custom fields protected function beforeFill(): void { $this->data = app(CustomFieldsImporter::class)->filterCustomFieldsFromData($this->data); } // After saving model, save custom fields protected function afterSave(): void { // Get the tenant if using multi-tenancy $tenant = Filament::getTenant(); app(CustomFieldsImporter::class)->saveCustomFieldValues( $this->record, // The model instance $this->getOriginalData(), // Original data with custom fields $tenant // Optional: tenant for multi-tenancy ); } } ``` -------------------------------- ### Database Table and Column Name Configuration Source: https://custom-fields.relaticle.com/essentials/configuration This configuration section allows you to define custom names for database tables used by the package to store custom fields, their values, and options. It also provides an option to customize column names, such as the tenant foreign key. ```PHP [ 'custom_field_sections' => 'custom_field_sections', 'custom_fields' => 'custom_fields', 'custom_field_values' => 'custom_field_values', 'custom_field_options' => 'custom_field_options', ], /* |-------------------------------------------------------------------------- | Column Names |-------------------------------------------------------------------------- | | Here you can customize the names of specific columns used by the package. | For example, you can change the name of the tenant foreign key if needed. | */ 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', ], ]; ``` -------------------------------- ### Database Table and Column Name Configuration Source: https://custom-fields.relaticle.com/essentials This configuration section allows you to define custom names for database tables used by the package to store custom fields, their values, and options. It also provides an option to customize column names, such as the tenant foreign key. ```PHP [ 'custom_field_sections' => 'custom_field_sections', 'custom_fields' => 'custom_fields', 'custom_field_values' => 'custom_field_values', 'custom_field_options' => 'custom_field_options', ], /* |-------------------------------------------------------------------------- | Column Names |-------------------------------------------------------------------------- | | Here you can customize the names of specific columns used by the package. | For example, you can change the name of the tenant foreign key if needed. | */ 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', ], ]; ``` -------------------------------- ### PHP Configuration for Custom Fields Source: https://custom-fields.relaticle.com/essentials This PHP configuration file allows extensive customization of the Custom Fields package. It controls features like encryption, entity resource table columns and filters, custom field type formats, resource registration, and tenant awareness. The structure is organized into logical sections for clarity and ease of modification. ```php return [ /* |-------------------------------------------------------------------------- | Features |-------------------------------------------------------------------------- | | This section controls the features of the Custom Fields package. | You can enable or disable features as needed. | */ 'features' => [ 'encryption' => [ 'enabled' => true, ], ], /* |-------------------------------------------------------------------------- | Entity Resources Customization |-------------------------------------------------------------------------- | | This section allows you to customize the behavior of entity resources, | such as enabling table column toggling and setting default visibility. | */ 'resource' => [ 'table' => [ 'columns' => [ 'enabled' => true, ], 'columns_toggleable' => [ 'enabled' => true, 'user_control' => true, 'hidden_by_default' => true, ], 'filters' => [ 'enabled' => true, ], ], ], /* |-------------------------------------------------------------------------- | Custom Field Types Configuration |-------------------------------------------------------------------------- | | This section controls the Custom Field Types. | This allows you to customize the behavior of the field types. | */ 'field_types_configuration' => [ 'date' => [ 'native' => false, 'format' => 'Y-m-d', 'display_format' => null, ], 'date_time' => [ 'native' => false, 'format' => 'Y-m-d H:i:s', 'display_format' => null, ], ], /* |-------------------------------------------------------------------------- | Custom Fields Resource Configuration |-------------------------------------------------------------------------- | | This section controls the Custom Fields resource. | This allows you to customize the behavior of the resource. | */ 'custom_fields_resource' => [ 'should_register_navigation' => true, 'slug' => 'custom-fields', 'navigation_sort' => -1, 'navigation_group' => true, 'cluster' => null, ], /* |-------------------------------------------------------------------------- | Entity Resources Configuration |-------------------------------------------------------------------------- | | This section controls which Filament resources are allowed or disallowed | to have custom fields. You can specify allowed resources, disallowed | resources, or leave them empty to use default behavior. | */ 'allowed_entity_resources' => [ // App\Filament\Resources\UserResource::class, ], 'disallowed_entity_resources' => [ // ], /* |-------------------------------------------------------------------------- | Lookup Resources Configuration |-------------------------------------------------------------------------- | | Define which Filament resources can be used as lookups. You can specify | allowed resources, disallowed resources, or leave them empty to use | default behavior. | */ 'allowed_lookup_resources' => [ // ], 'disallowed_lookup_resources' => [ // ], /* |-------------------------------------------------------------------------- | Tenant Awareness Configuration |-------------------------------------------------------------------------- | | When enabled, this feature implements multi-tenancy using the specified | tenant foreign key. Enable this before running migrations to automatically | register the tenant foreign key. | */ 'tenant_aware' => false, /* |-------------------------------------------------------------------------- | Database Migrations Paths |-------------------------------------------------------------------------- | | In these directories custom fields migrations will be stored and ran when migrating. A custom fields | migration created via the make:custom-fields-migration command will be stored in the first path or | a custom defined path when running the command. | */ 'migrations_paths' => [ database_path('custom-fields'), ], /* |-------------------------------------------------------------------------- | Database Table Names |-------------------------------------------------------------------------- | ``` -------------------------------- ### PHP Configuration for Custom Fields Source: https://custom-fields.relaticle.com/essentials/configuration This PHP configuration file allows extensive customization of the Custom Fields package. It controls features like encryption, entity resource table columns and filters, custom field type formats, resource registration, and tenant awareness. The structure is organized into logical sections for clarity and ease of modification. ```php return [ /* |-------------------------------------------------------------------------- | Features |-------------------------------------------------------------------------- | | This section controls the features of the Custom Fields package. | You can enable or disable features as needed. | */ 'features' => [ 'encryption' => [ 'enabled' => true, ], ], /* |-------------------------------------------------------------------------- | Entity Resources Customization |-------------------------------------------------------------------------- | | This section allows you to customize the behavior of entity resources, | such as enabling table column toggling and setting default visibility. | */ 'resource' => [ 'table' => [ 'columns' => [ 'enabled' => true, ], 'columns_toggleable' => [ 'enabled' => true, 'user_control' => true, 'hidden_by_default' => true, ], 'filters' => [ 'enabled' => true, ], ], ], /* |-------------------------------------------------------------------------- | Custom Field Types Configuration |-------------------------------------------------------------------------- | | This section controls the Custom Field Types. | This allows you to customize the behavior of the field types. | */ 'field_types_configuration' => [ 'date' => [ 'native' => false, 'format' => 'Y-m-d', 'display_format' => null, ], 'date_time' => [ 'native' => false, 'format' => 'Y-m-d H:i:s', 'display_format' => null, ], ], /* |-------------------------------------------------------------------------- | Custom Fields Resource Configuration |-------------------------------------------------------------------------- | | This section controls the Custom Fields resource. | This allows you to customize the behavior of the resource. | */ 'custom_fields_resource' => [ 'should_register_navigation' => true, 'slug' => 'custom-fields', 'navigation_sort' => -1, 'navigation_group' => true, 'cluster' => null, ], /* |-------------------------------------------------------------------------- | Entity Resources Configuration |-------------------------------------------------------------------------- | | This section controls which Filament resources are allowed or disallowed | to have custom fields. You can specify allowed resources, disallowed | resources, or leave them empty to use default behavior. | */ 'allowed_entity_resources' => [ // App\Filament\Resources\UserResource::class, ], 'disallowed_entity_resources' => [ // ], /* |-------------------------------------------------------------------------- | Lookup Resources Configuration |-------------------------------------------------------------------------- | | Define which Filament resources can be used as lookups. You can specify | allowed resources, disallowed resources, or leave them empty to use | default behavior. | */ 'allowed_lookup_resources' => [ // ], 'disallowed_lookup_resources' => [ // ], /* |-------------------------------------------------------------------------- | Tenant Awareness Configuration |-------------------------------------------------------------------------- | | When enabled, this feature implements multi-tenancy using the specified | tenant foreign key. Enable this before running migrations to automatically | register the tenant foreign key. | */ 'tenant_aware' => false, /* |-------------------------------------------------------------------------- | Database Migrations Paths |-------------------------------------------------------------------------- | | In these directories custom fields migrations will be stored and ran when migrating. A custom fields | migration created via the make:custom-fields-migration command will be stored in the first path or | a custom defined path when running the command. | */ 'migrations_paths' => [ database_path('custom-fields'), ], /* |-------------------------------------------------------------------------- | Database Table Names |-------------------------------------------------------------------------- | ``` -------------------------------- ### Create Feature Branch Source: https://custom-fields.relaticle.com/help-support/contributing Creates a new Git branch for developing new features or fixing bugs, encouraging descriptive branch names. ```shell git checkout -b feature/your-feature-name ``` -------------------------------- ### Custom Fields Migration API Source: https://custom-fields.relaticle.com/essentials/preset-custom-fields Defines the API for creating and updating custom fields within Filament resources using migrations. It includes methods for specifying field types, properties, options, and linking to related models. ```APIDOC CustomFieldsMigration API: Field Types: - TEXT: Basic text input - NUMBER: Numeric input - SELECT: Dropdown selection - MULTI_SELECT: Multiple selection - DATE: Date picker - TOGGLE: Boolean toggle switch - TEXTAREA: Multi-line text input (Refer to CustomFieldType enum for a complete list) Creating Fields: Use the `new()` method within a migration's `up()` method. `$this->migrator->new( model: string, type: CustomFieldType, name: string, code: string )->create();` - `model`: The Eloquent model class for which the field is created (e.g., `Opportunity::class`). - `type`: The type of custom field, using `CustomFieldType` enum (e.g., `CustomFieldType::TEXT`). - `name`: The human-readable name of the field (e.g., 'Name'). - `code`: A unique code identifier for the field (e.g., 'name'). Additional methods for field creation: - `options(array $options)`: Sets the available options for `SELECT` or `MULTI_SELECT` fields. Example: `->options(['New', 'Screening', 'Meeting'])` - `lookupType(string $modelClass)`: Links a `SELECT` field to a model for dynamic options. Example: `->lookupType(User::class)` Updating Fields: Use the `find()` and `update()` methods within a migration's `up()` method. `$this->migrator->find(string $modelClass, string $fieldCode)` - Finds an existing custom field. `->options(array $options)` - Updates the options for a `SELECT` or `MULTI_SELECT` field. `->update();` - Persists the changes to the field. Example: `$this->migrator ->find(Opportunity::class, 'stage') ->options([ 'New', 'Qualified', 'Proposal', 'Negotiation', 'Closed Won', 'Closed Lost', ]) ->update(); ``` -------------------------------- ### Extend Base Models for Custom Functionality Source: https://custom-fields.relaticle.com/essentials Create your own custom model classes by extending the base models provided by the Relaticle Custom Fields package. This allows for adding custom methods or overriding existing attribute getters. ```PHP namespace App\Models; use Relaticle\CustomFields\Models\CustomField as BaseCustomField; class YourCustomField extends BaseCustomField { // Add custom functionality public function someCustomMethod() { // Your implementation } // Override methods if needed public function getNameAttribute($value) { return ucfirst($value); } } ``` -------------------------------- ### Integrate Custom Fields into Filament Model and Resource Source: https://custom-fields.relaticle.com/introduction Demonstrates the minimal code required to enable custom fields for a Filament resource. This involves implementing the HasCustomFields trait in your Eloquent model and adding the CustomFieldsComponent to your Filament form schema, eliminating the need for database migrations for new fields. ```PHP // 1. Add to your model use Relaticle\FilamentCustomFields\Traits\UsesCustomFields; use Relaticle\FilamentCustomFields\Contracts\HasCustomFields; class Product extends Model implements HasCustomFields { use UsesCustomFields; } // 2. Add to your Filament resource use Filament\Forms\Components\Component; use Relaticle\FilamentCustomFields\Components\CustomFieldsComponent; public function form(Form $form): Form { return $form->schema([ // Your existing fields... CustomFieldsComponent::make(), ]); } ``` -------------------------------- ### Conventional Commit Message Format Source: https://custom-fields.relaticle.com/help-support/contributing Specifies the format for commit messages, using types like feat, fix, docs, style, refactor, test, chore, and allowing for longer descriptions and issue linking. ```shell type(scope): brief description Longer explanation if needed Closes #123 ``` -------------------------------- ### Extend Base Models for Custom Functionality Source: https://custom-fields.relaticle.com/essentials/configuration Create your own custom model classes by extending the base models provided by the Relaticle Custom Fields package. This allows for adding custom methods or overriding existing attribute getters. ```PHP namespace App\Models; use Relaticle\CustomFields\Models\CustomField as BaseCustomField; class YourCustomField extends BaseCustomField { // Add custom functionality public function someCustomMethod() { // Your implementation } // Override methods if needed public function getNameAttribute($value) { return ucfirst($value); } } ``` -------------------------------- ### Integrate Custom Fields into Filament Model and Resource Source: https://custom-fields.relaticle.com/index Demonstrates the minimal code required to enable custom fields for a Filament resource. This involves implementing the HasCustomFields trait in your Eloquent model and adding the CustomFieldsComponent to your Filament form schema, eliminating the need for database migrations for new fields. ```PHP // 1. Add to your model use Relaticle\FilamentCustomFields\Traits\UsesCustomFields; use Relaticle\FilamentCustomFields\Contracts\HasCustomFields; class Product extends Model implements HasCustomFields { use UsesCustomFields; } // 2. Add to your Filament resource use Filament\Forms\Components\Component; use Relaticle\FilamentCustomFields\Components\CustomFieldsComponent; public function form(Form $form): Form { return $form->schema([ // Your existing fields... CustomFieldsComponent::make(), ]); } ``` -------------------------------- ### Add Export Action to Filament Resource Source: https://custom-fields.relaticle.com/essentials/import-export This snippet shows how to integrate the `ExportAction` into a Filament resource's `getActions` method. It requires the `ExportAction` class and a custom exporter class (e.g., `ProductExporter`). The action allows users to export resource data. ```PHP use Filament\Actions\ExportAction; use App\Filament\Exports\ProductExporter; // In your resource class public static function getActions(): array { return [ ExportAction::make() ->exporter(ProductExporter::class), ]; } ``` -------------------------------- ### Generate Custom Fields Migration Source: https://custom-fields.relaticle.com/essentials/preset-custom-fields Uses the Artisan command to create a new custom fields migration file. This command generates a file in the `database/migrations/custom-fields` directory with a timestamp prefix and the specified name. ```php php artisan make:custom-fields-migration CreateGeneralCustomFieldsForOpportunity ``` -------------------------------- ### Register Custom Models in Service Provider Source: https://custom-fields.relaticle.com/essentials/configuration Register custom model classes for CustomField, Value, Option, and Section within your application's service provider. This allows you to use your own implementations instead of the default ones. ```PHP use Relaticle\CustomFields\CustomFields; class AppServiceProvider extends ServiceProvider { public function boot() { // Register your custom models CustomFields::useCustomFieldModel(YourCustomField::class); CustomFields::useValueModel(YourCustomFieldValue::class); CustomFields::useOptionModel(YourCustomFieldOption::class); CustomFields::useSectionModel(YourCustomFieldSection::class); } } ``` -------------------------------- ### Register Custom Models in Service Provider Source: https://custom-fields.relaticle.com/essentials Register custom model classes for CustomField, Value, Option, and Section within your application's service provider. This allows you to use your own implementations instead of the default ones. ```PHP use Relaticle\CustomFields\CustomFields; class AppServiceProvider extends ServiceProvider { public function boot() { // Register your custom models CustomFields::useCustomFieldModel(YourCustomField::class); CustomFields::useValueModel(YourCustomFieldValue::class); CustomFields::useOptionModel(YourCustomFieldOption::class); CustomFields::useSectionModel(YourCustomFieldSection::class); } } ```