merotech/appendable-dynamic-dropdown

This package is abandoned and no longer maintained. No replacement package was suggested.

A Laravel Nova field.

dev-master 2020-01-02 17:10 UTC

This package is auto-updated.

Last update: 2023-02-06 04:21:54 UTC


README

68747470733a2f2f6d65726f2e636f2f77702d636f6e74656e742f75706c6f6164732f323031392f30332f6d65726f6c6f676f7472616e73706172656e742d3133367836302e706e67

Nova Appendable Select is a multi field that contains a select element and an input element. The select elements populates based on the Nova resource you are calling the component from and the tableName you pass as seen below.

AppendableDynamicDropdown::make('Brand')->rules('required')

In the example above we add this to the Nova Resource Router. So this multi field component will now populate all unique brand names from the routers table. To add a new brand name not already present in the routers table the input field will take new values and when submitting the form this new value will be present in the select field on subsequent form submits.

Who Uses Nova Appendable Select

Usage

Laravel Nova Applications

Suitable when you want a dynamic select field that is populated based on a model in your database and you want to add to this

Show instructions
  1. Install the preset:

    $ composer require merotech/nova-appendable-select
    
  2. Add the Nova Field Component to your Nova resource

    use Merotech\AppendableDynamicDropdown\AppendableDynamicDropdown;
    
  3. You're all set!