Skip to content

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

Notifications You must be signed in to change notification settings

0x15f/select-or-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

select-or-text

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 lynndigital/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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published