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

Make the field inherit from native Image and not only File field #47

Closed
ctessier opened this issue Jun 7, 2020 · 5 comments
Closed

Comments

@ctessier
Copy link
Owner

ctessier commented Jun 7, 2020

The Nova Advanced Image field inherit from the native File field.

Inheriting from the Image field would bring the following features:

  • rounded
  • squared
@guillaumeduval64
Copy link

Would it also accept default value?

@ctessier
Copy link
Owner Author

ctessier commented Jun 9, 2020

Would it also accept default value?

Hi @guillaumeduval64,

There is no native method in Nova for setting a default value for a field. This is the case for all field types, including File and Image.

Have a look here: laravel/nova-issues#58 (comment)
This should help you.

Have a good one!
Clément

@guillaumeduval64
Copy link

guillaumeduval64 commented Jun 9, 2020 via email

@ctessier
Copy link
Owner Author

Allo Clément :) Merci du retour super rapide! Oui justement j'avais vu mais check ça aussi sur la doc... https://nova.laravel.com/docs/3.0/resources/fields.html#default-values C'est sur la V3 par contre...

Ah, merci pour le tuyau, je découvre pour être honnête...
Par contre, après plusieurs tests, je n'ai pas l'impression que ce soit vraiment fait pour des champs de type "fichier".

Comment verrais-tu cette fonctionnalité fonctionner ?

Bonne soirée

@ctessier
Copy link
Owner Author

ctessier commented Sep 1, 2020

Hello @guillaumeduval64,

Après plusieurs test, je te confirme que cette fonctionnalité ne peut pas fonctionner avant le champ file (regarde https://stackoverflow.com/a/16367121).

Pour information, j'ai publié samedi une nouvelle version (v1.2.0) qui améliore grandement l'héritage avec les champs natifs File et Image.

N'hésites pas à y jeter un œil et me faire des retours si tu utilises toujours le package ;)

Bonne journée,
Clément

@ctessier ctessier closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants