novafieldcheckboxes icon indicating copy to clipboard operation
novafieldcheckboxes copied to clipboard

using checkboxes with dependency container

Open Dontorpedo opened this issue 6 years ago • 4 comments

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..

Dontorpedo avatar Jan 28 '19 15:01 Dontorpedo

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

m2de avatar Jan 29 '19 07:01 m2de

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?',
            ]),

Dontorpedo avatar Jan 29 '19 09:01 Dontorpedo

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'),

m2de avatar Feb 07 '19 08:02 m2de

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

´´´´

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

Dontorpedo avatar Feb 07 '19 11:02 Dontorpedo