nova-tab-translatable
nova-tab-translatable copied to clipboard
Slug preview does not work with multiple tabs instances
Hello, thanks for this useful package.
I have a model with multiple instances of NovaTabTranslatable and I get a 404 error when the slug preview is getting loaded.
The reason why this is happening is because this foreach cycle should terminate when the field is found.
Otherwise the following iterations will overwrite the value of $field
with null
.
// Kongulov\NovaTabTranslatable\Http\Controllers\FieldPreviewController, line 43
foreach ($tabs as $tab) {
$field = collect($tab->data)->first(function($field) use ($request){
return isset($field->attribute) &&
$field->attribute == $request->field;
});
}
Thank you very much