Skip to content

Commit

Permalink
update README.ms for custom model
Browse files Browse the repository at this point in the history
  • Loading branch information
cklei-carly committed Sep 2, 2024
1 parent 46ef8f8 commit b1927d5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,12 @@ This is the contents of the published config file:
```php
return [
'enabled' => false,
'models' => [
'field' => \SolutionForest\FilamentFieldGroup\Models\Field::class,
'field_group' => SolutionForest\FilamentFieldGroup\Models\FieldGroup::class,
],
'table_names' => [
'fields' => 'advanced_fields',
'field_groups' => 'advanced_field_groups',
],
];
```

## Usage
Expand Down Expand Up @@ -158,6 +155,19 @@ $panel
);
```

### Custom Models

This section allows you to customize the model used for field groups in the Filament Field Group package. By replacing the default `FieldGroup` model with your own implementation, you can extend or modify its behavior to suit your application's needs.
To do this, use the `replace` method from the `ModelManifest` facade, specifying the original model and your custom model. Here's an example:

```php
\SolutionForest\FilamentFieldGroup\Facades\ModelManifest::replace(
\SolutionForest\FilamentFieldGroup\Models\Contracts\FieldGroup::class,
Your\Models\FieldGroup::class
);
```

## Testing

```bash
Expand Down

0 comments on commit b1927d5

Please sign in to comment.