milenmk/laravel-simple-datatables-and-forms 问题修复 & 功能扩展

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

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

milenmk/laravel-simple-datatables-and-forms

最新稳定版本:2.1.13

Composer 安装命令:

composer require milenmk/laravel-simple-datatables-and-forms

包简介

Simple Table component to create datatables for Livewire components

README 文档

README

Latest Version on Packagist Total Downloads GitHub User's stars Laravel 10 Support PHP Version Support License Contributions Welcome Sponsor me

A lightweight, easy-to-use Laravel package for creating interactive data tables and dynamic forms with Livewire integration.

Screenshot Screenshot

Overview

Laravel Simple Datatables And Forms provides two powerful components for your Laravel applications:

📊 Data Tables

Create interactive, feature-rich data tables with minimal code. Includes advanced search, sorting, filtering, grouping, and export capabilities.

📝 Dynamic Forms

Build dynamic forms with fluent API, multiple field types, validation, and model binding support.

Key Features

  • 🔍 Advanced Search - Debounced search with minimum character requirements
  • 🔄 Column Sorting - Click-to-sort functionality for table columns
  • 🧹 Filtering & Grouping - Multiple filter types with advanced grouping options
  • 📤 Data Export - Export to CSV, Excel, and PDF formats
  • 📝 Dynamic Forms - Fluent features for building complex forms
  • 🔧 Multiple Field Types - Input, Select, Checkbox, Toggle, Textarea, and more
  • Validation Integration - Built-in Laravel validation support
  • 📱 Responsive Design - Mobile-friendly components
  • Performance Optimized - Intelligent caching and query optimization
  • 🔒 Security Features - CSRF protection and input sanitization
  • 🧩 Seamless Livewire Integration - Built specifically for Livewire 3.x

Requirements

  • PHP 8.2 or higher (compatible with PHP 8.3 and 8.4)
  • Laravel 10.x or higher (compatible with Laravel 11.x and 12.x)
  • Livewire 3.x or higher

Quick Start

Installation

composer require milenmk/laravel-simple-datatables-and-forms

Publish Configurations

php artisan vendor:publish --tag=laravel-simple-datatables-and-forms-config

Publish Assets

php artisan simple-datatables-and-forms:publish-assets

Include Assets in Your Layout

<head>
    @SimpleDatatablesStyle
</head>
<body>
    <!-- Your content -->
    @SimpleDatatablesScript
</body>

Create Your First Data Table

Generate a table component:

php artisan make:milenmk-datatable UserList User --generate

Or create manually:

use Milenmk\LaravelSimpleDatatablesAndForms\Traits\HasTable;

class UserList extends Component
{
    use HasTable;

    public function table(Table $table): Table
    {
        return $table
            ->query(User::query())
            ->schema([
                TextColumn::make('name')->searchable()->sortable(),
                TextColumn::make('email')->searchable(),
                ToggleColumn::make('is_active')->label('Active'),
            ])
            ->striped()
            ->paginate();
    }
}

Create Your First Form

Generate a form component:

php artisan make:milenmk-form CreateUser create User --generate

Or create manually:

use Milenmk\LaravelSimpleDatatablesAndForms\Traits\HasForm;

class CreateUser extends Component
{
    use HasForm;

    public function form(Form $form): Form
    {
        return $form->model(User::class)->schema([
            InputField::make('name')->required(),
            InputField::make('email')->email()->required(),
            SelectField::make('role')
                ->options(['admin' => 'Admin', 'user' => 'User'])
                ->required(),
        ]);
    }
}

Documentation

📚 Complete Documentation

📊 Data Tables Documentation

📝 Forms Documentation

Tailwind CSS Integration

Add the package views to your Tailwind configuration:

// tailwind.config.js
module.exports = {
    content: [
        // ... your existing content paths
        './vendor/milenmk/laravel-simple-datatables-and-forms/resources/views/**/*.blade.php',
    ],
    // ... rest of your configuration
};

Contributing

Contributions are welcome! Please visit our GitHub repository to:

  • Report bugs or request features
  • Submit pull requests
  • Browse existing issues
  • Join discussions

Support

Changelog

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

Support My Work

If this package saves you time, you can support ongoing development:
👉 Become a Patron

Other Packages

Check out my other Laravel packages:

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Disclaimer

This package is provided "as is", without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or noninfringement.

The author(s) make no guarantees regarding the accuracy, reliability, or completeness of the code, and shall not be held liable for any damages or losses arising from its use.

Please ensure you thoroughly test this package in your environment before deploying it to production.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-16