bithaolee/select-or-custom

A Laravel Nova field.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 5

Language:Vue

1.0.0 2023-07-27 15:59 UTC

This package is auto-updated.

Last update: 2024-10-27 18:47:25 UTC


README

Laravel Nova custom field that allows you to have a select drop-down or custom text!

Install

You can install select-or-text using composer:

composer require bithaolee/select-or-custom

Then add the following code to your resources fields method:

\Lynndigital\SelectOrCustom\SelectOrCustom::make('Field Name')->options([]);

The field has an options method similar to that of Laravel Nova's Select field, it allows you to pass default options that may be selected.

Screenshots:

Add the field to nova: Code

The select field. The select field

Select one of your provided options, or choose "Custom (Free Text)" to add a custom value. Options

The field when a provided option is selected: Select box

The field when a custom value can be entered (a simple text field): Text input