Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

added nova dependency container comptibility and added text edit #6

Merged
merged 6 commits into from
Jan 12, 2021
Merged
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
13 changes: 11 additions & 2 deletions src/Http/Controllers/OptionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public function index(NovaRequest $request)

$field = $fields->findFieldByAttribute($attribute);

// Flexible content compatibility:
// https://github.com/whitecube/nova-flexible-content
if (!$field) {
foreach ($fields as $updateField) {
// Flexible content compatibility:
// https://github.com/whitecube/nova-flexible-content
if ($updateField->component == 'nova-flexible-content') {
foreach ($updateField->meta['layouts'] as $layout) {
foreach ($layout->fields() as $layoutField) {
Expand All @@ -35,6 +35,15 @@ public function index(NovaRequest $request)
}
}
}

// Dependency container compatibility:
// https://github.com/epartment/nova-dependency-container
} elseif ($updateField->component == 'nova-dependency-container') {
foreach ($updateField->meta['fields'] as $layoutField) {
if ($layoutField->attribute == $attribute) {
$field = $layoutField;
}
}
}
}
}
Expand Down