Open jaros93 opened 2 years ago
Hi @jaros93 are you asking for the developers to "Add Nova 4 compatibility"?
"Added" is past tense and implies you've done this already.
In any case Nova 4 adds native support for Dependant Fields.
I wonder if anyone can comment on the native functionality vs that of this package? And whether this package is still required.
It's not exactly the same
This convenient notation is not possible
NovaDependencyContainer::make([
Text::make('First Name', 'first_name')
])->dependsOn('name_format', 0),
It is not possible to use it
It is necessary to set a condition for each field
And it is not possible to use either hideWhenCreating()
hideWhenCreating()
https://nova.laravel.com/docs/4.0/resources/fields.html#showing-hiding-fields
only e.g. readonly()
required()
default()
@GarethSomers The new dependent functionality works very well in Nova 4, but there are some main issues which made me choose for this package still:
Not all fields are supported for the dependent functionality, for example the Markdown field (which isn't even mentioned in the docs) https://nova.laravel.com/docs/4.0/resources/fields.html#dependent-fields
Also the key difference is that the default dependsOn from Nova 4 itself does not check on all events/changes of your dependent field, for example one of the big ones is a boolean field, when you set a default value as 'true' on it it will not detect it on your Edit page, which makes it not yet reliable.
and last but not least, this package makes it possible to use the dependent functionality on a quick and easy way without having to write any difficult logics.
Nova 4 support will be there in the future, but not yet. But surely feel free to open a PR and we'll check it as fast as possible!
Also (it seems ridiculous) but Laravel nova dependent functionality doesnt work on Action. check this https://github.com/laravel/nova-issues/issues/3897
Hi from Argentina. Also suffering from Nova 4.0 "enhancements" and plugins compatibility. I have some projects where I had to leave them at Nova 3 due to the amount of plugins not working in the new version. Piece of advice: let's start learning how to build our own plugins. Can't depend on this kind of issues.
Just tried to find a solution this weekend and got failed. in the first step we need to upgrade to Vue 3. since it is trying to get all of the components list via this.$root.$children
which doesn't exists in Vue 3. this is where the issue happens
@mehrancodes indeed, we'll have to upgrade to Vue 3. Haven't got the time yet to take a look at it but feel free to open a PR 😇
@NoahNxT Yes true, and UNF it needs a deep understanding of Vue 3. I believe the easier way would be to start the frontend side from zero since in Vue 3 we have composition API and the things can be done different than Vue 2
There is a Nova 4 compatible fork here, not sure why they never created a PR for you guys but perhaps someone could take inspiration from it:
@dmason30 thanks for the info! We will try to take a look ASAP.
@NoahNxT I also did a deep look at the Nova source code just noticed we can get rid of most of the complex parts by using events! for example the watchers registration, etc... Also tested it out quickly and it did work!
For now I would go with the above PR since we need it on prod but would make a PR soon for the event driven solution
+1 im still reaching for this package over nova 4 dependsOn
a lot of the time
will use the fork posted in the replies for now.
Hi There
I'm looking at upgrading this to Nova 4 and the main issue is the retirement of the $children
property in Vue 3 so without direct access the child component instances, it's kinda difficult for this package to function :(
@samdharris You can see how this fork got around this here
Also (it seems ridiculous) but Laravel nova dependent functionality doesnt work on Action. check this laravel/nova-issues#3897
Nova 4 now supports dependent fields in actions!
@mehrancodes Did you finished your PR?
ping @mehrancodes
Added Nova 4 compatibility.