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
- Getting Started - Installation and basic usage
- API Reference - Complete API documentation
Form Components
Text Inputs
- Text Input - Text, email, password, URL inputs
- Textarea - Multi-line text with autosize
- Number Field - Numeric input with controls
Selection Components
- Select - Dropdown with search, multiple, remote options
- Checkbox - Single checkbox
- Checkbox List - Multiple checkbox selection
- Radio - Radio button groups
- Toggle - Toggle switch
- Toggle Buttons - Button-style toggles
Rich Content Editors
- Rich Editor - WYSIWYG editor
- TipTap Editor - TipTap-based editor
- Markdown Editor - Markdown with preview
Date & Time
- Date Picker - Date selection
- Time Picker - Time selection
- DateTime Picker - Combined date/time
- Date Range Picker - Date range selection
Specialized Inputs
- File Upload - File uploads with FilePond
- Icon Picker - Icon selection
- Color Picker - Color selection
- Tags Input - Tag input with suggestions
- Pin Input - PIN/OTP code input
- Rate Input - Star rating
- Slider - Range slider
- Key Value - Key-value pair editor
- Repeater - Repeatable field groups
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 accelade/forms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.
Field for number with restricted count of digits and decimal places
HTML and form generation
Build forms from schema
A Laravel Filament Forms slug field.
Adds request-parameter validation to the SLIM 3.x PHP framework
统计信息
- 总下载量: 171
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-18