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

using checkboxes with dependency container #17

Open
Dontorpedo opened this issue Jan 28, 2019 · 4 comments
Open

using checkboxes with dependency container #17

Dontorpedo opened this issue Jan 28, 2019 · 4 comments

Comments

@Dontorpedo
Copy link

Hi i try to use your checkboxesfield with this package

https://novapackages.com/packages/epartment/nova-dependency-container

but i dont know how to use it together, is it even possible?

using with booleans was easy but, cant find the right value to use..

@m2de
Copy link
Contributor

m2de commented Jan 29, 2019

Hi @Dontorpedo. Are you able to share any code examples of what you are trying to setup please?

@Dontorpedo
Copy link
Author

Dontorpedo commented Jan 29, 2019

right now i use the dependency container like so:

        Boolean::make('Print', 'print'),
        Boolean::make('ZIP'),
		Boolean::make('send per mail?', 'email'),
            NovaDependencyContainer::make([
				Text::make('Recipient', 'email_to'),
                Text::make('Subject', 'email_subject'),
				Textarea::make('Nachricht', 'email_message')
            ])->dependsOnNotEmpty('email', 0),
		Boolean::make('Manual invoice', 'manual_invoice'),

then i am also checking in my code like

if ($fields->email == 1) :

i try to replace the booleans with your checkboxes bc. yours is more compact.. ;)

            Checkboxes::make('Options')->options([
                'print' => 'Print',
                'ZIP' => 'ZiP download',
                'email' => 'send per mail?',
            ]),

@m2de
Copy link
Contributor

m2de commented Feb 7, 2019

Thanks @Dontorpedo ... makes sense. You need to change ...

NovaDependencyContainer::make([
	Text::make('Recipient', 'email_to'),
         Text::make('Subject', 'email_subject'),
	 Textarea::make('Nachricht', 'email_message')
])->dependsOn('options', 'email'),

@Dontorpedo
Copy link
Author

´´´´
->dependsOnNotEmpty('optionen', 'emails', 0),

´´´´

ha, works.. thanks.. but it works only one-way.. unckexng the checkbox doesnt close the element.

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