Skip to main content

Posts

Showing posts with the label plugin

How to handle laravel fields error according to data tables editor plugin create & edit

How to handle laravel fields error according to data tables editor plugin create edit Before going to explain lets assume we want to create category and for time being we have one field that is name. And already we have controller,model and route established. For laravel field errors to be compatible with datatables editor we need to do following. Create form request for validation of category creation as below: File location: app / Http / Requests / File name: AddCategoryFormRequest.php File contents: namespace App\Http\Requests; use App\Http\Requests\CustomFormRequest; class AddCategoryFormRequest extends CustomFormRequest { public function rules() { return [ 'name' => 'required|max:255', ]; } } And category datatables and editor configuration as below: var create = new $.fn.dataTable.Editor({ ajax: {url: 'url here',type:'POST'}, table: '#categories-table...