Skip to content
This repository was archived by the owner on Sep 10, 2019. It is now read-only.

Add Nova fields method#40

Open
onemoreahmad wants to merge 1 commit intofourstacks:masterfrom
onemoreahmad:nova-fields
Open

Add Nova fields method#40
onemoreahmad wants to merge 1 commit intofourstacks:masterfrom
onemoreahmad:nova-fields

Conversation

@onemoreahmad
Copy link
Copy Markdown

As discussed here #34
this is a new branch trying to implement novaFields directly instead of the custom shipped fields. Not ready yet though, working on progress.

To add Nova fields you can now do something similar to :

   Repeater::make('Repater','content')
         ->addNovaFields([
             Heading::make('Nova Fields'),
             text::make('question'),
             Textarea::make('answer'),
             Select::make('Size')->options([
                'S' => 'Small',
                'M' => 'Medium',
                'L' => 'Large',
            ]),
            Date::make('Birthday'),
            Country::make('Country')->hideFromIndex(),
         ])
         ->addField([
             'label' => 'Language',
             'name' => 'language',
             'placeholder' => 'Language',
             'type' => 'select',
             'options' => [
                 'ar' => 'Arabic',
                 'en' => 'English',
                 'fr' => 'French',
             ],
         ])
         ->initialRows(1)
         ->displayStackedForm(),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant