accelade/forms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

accelade/forms

Composer 安装命令:

composer require accelade/forms

包简介

Form builder components for Accelade - create dynamic forms with text inputs, selects, checkboxes, and more

README 文档

README

A powerful form builder package for Laravel and Accelade. Create dynamic forms with a Filament-compatible API using Blade components.

Installation

composer require accelade/forms

The package will auto-register its service provider.

Quick Start

use Accelade\Forms\Form;
use Accelade\Forms\Components\TextInput;
use Accelade\Forms\Components\Select;
use Accelade\Forms\Components\Toggle;

$form = Form::make()
    ->action('/users')
    ->schema([
        TextInput::make('name')
            ->label('Full Name')
            ->required()
            ->placeholder('Enter your name'),

        TextInput::make('email')
            ->email()
            ->required(),

        Select::make('role')
            ->options([
                'admin' => 'Administrator',
                'editor' => 'Editor',
                'viewer' => 'Viewer',
            ])
            ->searchable(),

        Toggle::make('active')
            ->label('Active Status'),
    ]);

Available Components

Text Inputs

  • TextInput - Text, email, password, URL, tel, and numeric inputs
  • Textarea - Multi-line text input with autosize support
  • Hidden - Hidden form fields

Selection

  • Select - Dropdown select with searchable, multiple, and remote options
  • CheckboxList - Multiple checkbox selection with grid layout
  • Radio - Radio button groups
  • Checkbox - Single checkbox
  • Toggle - Toggle switch
  • ToggleButtons - Button-style toggle group

Rich Content

  • RichEditor - WYSIWYG editor with toolbar customization
  • TipTapEditor - TipTap-based editor with collaboration support
  • MarkdownEditor - Markdown editing with preview

Specialized

  • FileUpload - File uploads with FilePond integration
  • IconPicker - Icon selection from multiple icon sets
  • ColorPicker - Color selection with presets
  • DatePicker / TimePicker / DateTimePicker - Date/time selection
  • DateRangePicker - Date range selection
  • TagsInput - Tag input with suggestions
  • EmojiInput - Emoji picker
  • PinInput - PIN/OTP code input
  • RateInput - Star rating input
  • Slider - Range slider input
  • NumberField - Numeric input with increment/decrement
  • KeyValue - Key-value pair editor
  • Repeater - Repeatable field groups

Layout

  • Group - Group fields together

Component Examples

TextInput

TextInput::make('username')
    ->label('Username')
    ->placeholder('Enter username')
    ->required()
    ->minLength(3)
    ->maxLength(20)
    ->prefix('@')
    ->hint('Your unique identifier');

// Email input
TextInput::make('email')->email()->required();

// Password input
TextInput::make('password')->password()->required();

// With date picker
TextInput::make('birthday')
    ->datePicker()
    ->format('Y-m-d');

Select

// Basic select
Select::make('country')
    ->options([
        'us' => 'United States',
        'uk' => 'United Kingdom',
        'ca' => 'Canada',
    ])
    ->searchable();

// Multiple selection
Select::make('tags')
    ->multiple()
    ->options($tags);

// With Choices.js styling
Select::make('category')
    ->choices(['searchEnabled' => true])
    ->options($categories);

// Remote options
Select::make('user')
    ->remoteUrl('/api/users')
    ->remoteRoot('data')
    ->optionLabel('name')
    ->optionValue('id');

// With relationship
Select::make('roles')
    ->relation('roles')
    ->multiple();

FileUpload

// Image upload
FileUpload::make('avatar')
    ->image()
    ->maxSize(2048)
    ->disk('public')
    ->directory('avatars');

// Multiple files
FileUpload::make('documents')
    ->multiple()
    ->maxFiles(5)
    ->acceptedFileTypes(['application/pdf', 'image/*'])
    ->downloadable();

// With FilePond
FileUpload::make('photos')
    ->filepond(['allowImagePreview' => true])
    ->multiple();

// With Spatie Media Library
FileUpload::make('gallery')
    ->collection('gallery')
    ->mediaBrowser();

CheckboxList

CheckboxList::make('permissions')
    ->options([
        'create' => 'Create',
        'read' => 'Read',
        'update' => 'Update',
        'delete' => 'Delete',
    ])
    ->columns(2)
    ->bulkToggleable()
    ->descriptions([
        'create' => 'Ability to create new records',
        'delete' => 'Ability to delete records',
    ]);

RichEditor

RichEditor::make('content')
    ->toolbarButtons([
        'bold', 'italic', 'underline',
        '|',
        'bulletList', 'orderedList',
        '|',
        'link', 'attachFiles',
    ])
    ->fileAttachmentsDisk('public')
    ->fileAttachmentsDirectory('uploads');

IconPicker

IconPicker::make('icon')
    ->sets(['emoji', 'heroicons'])
    ->defaultSet('heroicons')
    ->searchable()
    ->gridColumns(10);

// With Blade Icons
IconPicker::make('icon')
    ->bladeIcons()
    ->perPage(50);

Form Configuration

Form::make()
    ->action('/submit')
    ->method('POST')
    ->hasFiles() // Enable file uploads
    ->confirm('Are you sure?')
    ->confirmButtonText('Yes, submit')
    ->cancelButtonText('Cancel')
    ->stayOnPage() // Don't redirect after submit
    ->preserveScroll()
    ->resetOnSuccess()
    ->submitOnChange() // Auto-submit on field change
    ->debounce(500)
    ->schema([...]);

Validation

Validation rules are automatically extracted from field definitions:

TextInput::make('email')
    ->email()
    ->required()
    ->rules(['unique:users,email']);

You can also use Form Request validation alongside component rules.

Documentation

Detailed documentation for each component is available in the docs directory:

Getting Started

Form Components

  • Form - Form wrapper component
  • Group - Field grouping
  • Submit - Submit button

Text Inputs

Selection Components

Rich Content Editors

Date & Time

Specialized Inputs

Configuration

Publish the config file:

php artisan vendor:publish --tag=forms-config

Requirements

  • PHP 8.2+
  • Laravel 11.0+ or 12.0+
  • Accelade core package

Testing

composer test

License

MIT License. See LICENSE for details.

accelade/forms 适用场景与选型建议

accelade/forms 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 171 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「validation」 「Forms」 「laravel」 「blade」 「inputs」 「form-builder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 accelade/forms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 accelade/forms 我们能提供哪些服务?
定制开发 / 二次开发

基于 accelade/forms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

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