Closed acato-dev closed 2 years ago
I starting working on it and it seems harder than expected. It seems nova 4 doesn't let you extend the panel component and create panel on the fly during serialization
// ResolvesFields.php trait
protected function resolvePanelsFromFields(NovaRequest $request, FieldCollection $fields, $label)
{
// ...
$panels = $fieldsWithPanels->groupBy(function ($field) {
return $field->panel;
})->transform(function ($fields, $name) {
return tap(Panel::make($name)->withMeta(['fields' => $fields]), function ($panel) use ($fields) {
if ($fields->first() instanceof ResourceToolElement) {
$panel->withComponent($fields->first()->component)->withMeta(['prefixComponent' => false]);
}
});
})->toBase();
// ...
}
At the moment the only solution I see is to completely override this method (thus having a custom Resource class that overrides the panels with is messy)
If I can be of any help let me know. I'd be willing to chip in some time to figure it out as I use this package in almost all of my projects.
Hi,
We are interested into Nova4 support. Let me know if you need any help Regards
@Grafikart Creating/using custom panel (and with custom component) has been fixed in 4.2.3, can you review that and see if it does what you need it to?
I'm stuck I can't make it work, I cannot get the serialization I want and I moved to another task at the moment. So if someone want to follow up go ahead.
Hi,
I've tried to fix it but I've got the following error:
"message": "Attempt to read property \"component\" on null",
"exception": "ErrorException",
"file": "/opt/eom/vendor/laravel/nova/src/Panel.php",
"line": 91,
Regards
It should also include $field->assignedPanel = $this;
Hello @acato-dev
We've been busy with other projects and non Nova-related stuff and didn't have the time/project yet to use this with v4.
We would be happy to add some collaborators/maintainers to this package.
You could tell me which users are going to be involved and should be added as collaborators.
Kind regards
Hi,
To inform everyone, I'm currently on a different account (I was the starter on the previous topic on a different account) as I am representing Acato and we are looking to take over this package.
I'll start today and we are looking forward to creating a sustainable solution.
We will be requesting @bajramemini to take it over but we would love to do it and have the capacity available.