A lightweight, easy-to-use Laravel package for creating interactive data tables and dynamic forms with Livewire integration.
Laravel Simple Datatables And Forms provides two powerful components for your Laravel applications:
Create interactive, feature-rich data tables with minimal code. Includes advanced search, sorting, filtering, grouping, and export capabilities.
Build dynamic forms with fluent API, multiple field types, validation, and model binding support.
- π 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
- 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
composer require milenmk/laravel-simple-datatables-and-forms
php artisan vendor:publish --tag=laravel-simple-datatables-and-forms-config
php artisan simple-datatables-and-forms:publish-assets
<head>
@SimpleDatatablesStyle
</head>
<body>
<!-- Your content -->
@SimpleDatatablesScript
</body>
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();
}
}
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 Hub - Complete documentation index and navigation guide
- Troubleshooting Guide - Common issues and solutions
- Getting Started - Quick start guide for tables
- Column Types - Complete reference for all column types
- Configuration - Configuration guide and options
- Advanced Features - Search, filtering, export, and caching
- Getting Started - Quick start guide for forms
- Field Types - Complete reference for all field types
- Validation - Validation rules and techniques
- Advanced Features - Model binding and relationships
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
};
Contributions are welcome! Please visit our GitHub repository to:
- Report bugs or request features
- Submit pull requests
- Browse existing issues
- Join discussions
- Documentation - Comprehensive guides and examples
- GitHub Issues - Bug reports and feature requests
- Email Support - Direct support for complex issues
Please see CHANGELOG.md for more information on what has changed recently.
If this package saves you time, you can support ongoing development:
π Become a Patron
Check out my other Laravel packages:
- Laravel GDPR Cookie Manager - GDPR-compliant cookie consent management with user preference tracking
- Laravel Blacklist - A Laravel package for blacklist validation of user input
- Laravel Email Change Confirmation - Secure email change confirmation system
- Laravel GDPR Exporter - GDPR-compliant data export functionality
- Laravel Locations - Add Countries, Cities, Areas, Languages and Currencies models to your Laravel application
- Laravel Rate Limiting - Advanced rate limiting capabilities with exponential backoff
This package is licensed under the MIT License. See the LICENSE file for more details.
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.