PHP code example of ht3aa / only-one-active-toggle
1. Go to this page and download the library: Download ht3aa/only-one-active-toggle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ht3aa / only-one-active-toggle example snippets
use Ht3aa\OnlyOneActiveToggle\Fields\OnlyOneActiveToggle;
Forms\Components\Repeater::make('items')
->schema([
OnlyOneActiveToggle::make('is_active')
->label('Active Item'),
// ... other fields
])
use Ht3aa\OnlyOneActiveToggle\Fields\OnlyOneActiveToggle;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Repeater::make('items')
->schema([
Forms\Components\TextInput::make('name')
->