Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: MorphTo, singularLabel and dependency container #207

Open
preliot opened this issue May 13, 2022 · 0 comments
Open

Docs: MorphTo, singularLabel and dependency container #207

preliot opened this issue May 13, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@preliot
Copy link

preliot commented May 13, 2022

Suggestion for improvement of documentation for MorphTo field:

If you want to depend on morphTo and use singularLabel() on your Nova resources, the dependency won't work if you follow documentation. The solution is you must depend on the singular label (and not the Model/Class name).

Example:

MorphTo::make('Commentable')->types([
    Post::class,
    Video::class,
]),

NovaDependencyContainer::make([
    Text::make('Additional Text', 'additional'),
    Boolean::make('Visible', 'visible')
])
->dependsOn('commentable', Post::singularLabel()) 
@NoahNxT NoahNxT added the enhancement New feature or request label Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants