DataTables Editor Plugin Installation
[!NOTE] Special thanks to @bellwood and @DataTables for being generous for providing a license to support the development of this package.
Overview
The DataTables Editor plugin integrates the powerful DataTables Editor library with Laravel DataTables. It provides a complete CRUD (Create, Read, Update, Delete) interface for your DataTables, handling all the backend logic including validation, database transactions, and event hooks.
This plugin is particularly useful when you need an inline editing experience directly within your DataTables, allowing users to edit table data without navigating to separate forms.
[!WARNING] A premium license is required to use the DataTables Editor library. Please purchase a license before using this plugin.
Prerequisites
Before installing this plugin, ensure you have:
| Requirement | Version | Notes |
|---|---|---|
| Laravel | 13.x or later | Required |
| PHP | 8.3+ | Required for Laravel 13 |
| yajra/laravel-datatables | 13.x | Core package must be installed first |
| DataTables Editor License | Valid | Purchase here |
| DataTables Editor Library | Downloaded | From your DataTables account |
Installation
Step 1: Install the Package
composer require yajra/laravel-datatables-editor:"^13.0"
Step 2: Install Editor Assets
Follow the Editor Tutorial for detailed instructions on setting up the frontend assets.
Quick Start
Once installed, you can quickly create an editor class using the artisan command:
php artisan datatables:editor Posts --model
Then, follow the Editor Usage documentation to set up your routes and frontend.
Best Practices
[!TIP] Pro Tips for Success
- Always use database transactions - The Editor automatically wraps operations in transactions
- Set fillable attributes - Ensure your model has proper
$fillableproperty- Use validation rules - Always define validation rules for create, edit, and remove actions
- Return the model - In event hooks (creating, updating), return an array. In event hooks (created, updated, saved, deleted), return the
$modelinstance- DT_RowId for remove - Always validate
DT_RowIdinremoveRules()asrequired|exists:table,id
Related Documentation
| Documentation | Description |
|---|---|
| Editor Usage | Complete usage guide |
| Editor Commands | Artisan command reference |
| Editor Events | Event hooks documentation |
| Editor Model | Model configuration |
| Editor Rules | Validation rules reference |
| Editor Tutorial | Step-by-step tutorial |