Skip to content

Adds the ability to edit a boolean field directly from the index or detail page of a resource.

Notifications You must be signed in to change notification settings

smart145/inline-boolean

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Nova: Inline Boolean

Latest Stable Version Total Downloads License

Adds the ability to edit a boolean field directly from the index or detail page of a resource.

Prerequisites

Installation

$ composer require markrassamni/inline-boolean

Usage

Use the MarkRassamni\InlineBoolean\InlineBoolean field in your Nova resource:

use MarkRassamni\InlineBoolean\InlineBoolean;

class MyResource extends Resource
{
    public function fields(Request $request)
    {
        return [
            InlineBoolean::make('Enabled')
                ->inlineOnIndex()  // Use inline field on the index page
                ->inlineOnDetail()  // Use inline field on the detail page
                ->enableMessage('Boolean has been enabled.')  // Toast message when enabling boolean
                ->disableMessage('Boolean has been disabled.')  // Toast message when disabling boolean
                ->trueText('Enabled')  // Change the text describing true boolean values
                ->falseText('Disabled')  // Change the text describing false boolean values
                ->showTextOnIndex()  // Show true/false text beside the checkbox on the index page
        ];
    }
}

About

Adds the ability to edit a boolean field directly from the index or detail page of a resource.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 53.1%
  • PHP 28.4%
  • JavaScript 18.3%
  • SCSS 0.2%