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

Default values #43

Closed
JoseLuisRNP opened this issue Jul 8, 2020 · 2 comments
Closed

Default values #43

JoseLuisRNP opened this issue Jul 8, 2020 · 2 comments

Comments

@JoseLuisRNP
Copy link

I'm trying to set some default values but i dont' get it.

Example:

Multiselect::make('tag')->options([
    1 => 'First',
    2 => 'Second',
    3 => 'Third',
])

->default() method see like doesn't exist in Multiselect
->withMeta(['value' => [1, 2]) i work around withMeta without success.

Some help with it? I looking in closed issues like #37 and #22

@Tarpsvo
Copy link
Collaborator

Tarpsvo commented Jul 8, 2020

Did you test ->default()? Multiselect extends the Nova Field class, so it definitely has ->default(), I've even used it.

@JoseLuisRNP
Copy link
Author

JoseLuisRNP commented Jul 8, 2020

See like default not implemented in my version of Nova in this proyect, i look in another with the last Nova version and it is. In any case ->default() seem doesn't work.

I've managed to make it work with ->withMeta(['value' => [[1], [2]]]) finally. Maybe is goo idea put a example at the readme, if you doesn't have time and accept PR i will do it.

Thanks for this great package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants