承接 linhntaim/advanced-fields 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

linhntaim/advanced-fields

最新稳定版本:1.0.3

Composer 安装命令:

composer require linhntaim/advanced-fields

包简介

Advanced Fields for Filament's Form Builders.

README 文档

README

Latest Version on Packagist Total Downloads

Multiple Choice Grid/Radio Grid, Checkbox Grid, ... and more.

Installation

You can install the package via composer:

composer require linhntaim/advanced-fields

Optionally, you can publish the views using

php artisan vendor:publish --tag="advanced-fields-views"

Usage

Grid Fields

Supports: RadioGrid, CheckboxGrid.

use Filament\Schemas\Schema;
use LinhntAim\AdvancedFields\RadioGrid;
use LinhntAim\AdvancedFields\CheckboxGrid;

public function mount(): void
{
    $this->form->fill([

        // format of the state used for RadioGrid
        'filled_radio_grid' => [
            'row_1' => 'column_c',
            'row_2' => 'column_b',
            'row_3' => 'column_a',
        ],

        // format of the state used for CheckboxGrid
        'filled_checkbox_grid' => [
            'row_1' => [
                'column_c',
                'column_a',
            ],
            'row_2' => [
                'column_b',
                'column_c',
            ],
            'row_3' => [
                'column_a',
                'column_b',
            ],
        ],

    ]);
}

public function form(Schema $schema): Schema
{
    return $schema->components([

        ...,

        RadioGrid::make('radio_grid')
            ->options([
                'column_a' => 'Column A',
                'column_b' => 'Column B',
                'column_c' => 'Column C',
            ])
            ->rows([
                'row_1' => 'Row 1',
                'row_2' => 'Row 2',
                'row_3' => 'Row 3',
            ])
            // optionally, (one) radio must be checked in each row
            ->required()
            // optionally, disable specific column option(s)
            ->disableOptionWhen(fn($value) => $value == 'column_b')
            // optionally, set the label of the "Clear selection" button
            // - note: the button will be shown after checking any radio if not required
            ->clearButtonLabel('X'),

        ...,

        CheckboxGrid::make('checkbox_grid')
            ->options([
                'column_a' => 'Column A',
                'column_b' => 'Column B',
                'column_c' => 'Column C',
            ])
            ->rows([
                'row_1' => 'Row 1',
                'row_2' => 'Row 2',
                'row_3' => 'Row 3',
            ])
            // optionally, at least one checkbox must be checked in each row 
            ->required()
            // optionally, disable specific column option(s)
            ->disableOptionWhen(fn($value) => $value == 'column_b'),

        ...,

    ]);
}

Sample light theme

Sample dark theme

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固