Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ public static function getBreadcrumbs(Model $record, string $operation): array
}
```

### Overriding NestedCreateAction
By default a create page must be created when using a `NestedRelationManager`. You can disable this by adding the following to your `ManageRelatedRecords`. This allows you to configure the create action yourself i.e. make it a `slideOver` instead of redirecting to a new page.

```php
public static bool $ignoreCreateTrait = false;
```

## Contributing

Please see [CONTRIBUTING](./.github/CONTRIBUTING.md) for details.
Expand Down
6 changes: 5 additions & 1 deletion src/Actions/NestedCreateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ trait NestedCreateAction
{
protected function configureCreateAction(CreateAction $action): void
{
$resource = $this->getNestedResource();
if (isset(static::$ignoreCreateTrait) && static::$ignoreCreateTrait === true) {
return;
}

$resource = $this->getNestedResource();

/** @var Ancestor $ancestor */
$ancestor = $resource::getAncestor();

Expand Down