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

hidden input option #5

Open
atmediauk opened this issue May 4, 2019 · 2 comments
Open

hidden input option #5

atmediauk opened this issue May 4, 2019 · 2 comments

Comments

@atmediauk
Copy link

Is it possible to submit the field as a hidden input?

For example adding ->hidden() to the chain like:

            SluggableText::make('Name')
                ->rules('required'),
            Slug::make('Slug')
                ->slugUnique()
                ->slugModel(static::$model)
                ->rules('required', 'alpha_dash', 'max:80')
                ->creationRules('unique:somegroup,slug')
                ->hidden(),

I know I can do this through a custom field or by just setting the value in the model on ::saving but it would be nice to still make use of this packages rules, validation etc.

I'd like to set the value but just remove the visibility for some users.

@wize-wiz
Copy link
Contributor

wize-wiz commented Oct 10, 2019

@atmediauk you should be able to use all visiblity methods listed in nova's documentation in the section Showing / Hiding Fields.

So this example ..

Slug::make(...)
  ->hideWhenCreating()
  ->hideWhenUpdating()

.. will hide the slug field when updating and creating.

@nurmuhammet-ali
Copy link

@wize-wiz I know I'm late but @atmediauk asks to add to field hidden type, not fully removing. These don't work in our cases. ->hideWhenCreating()->hideWhenUpdating()

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

3 participants