@php # FORM METHOD ALWAYS DEFINED! if( !isset($method) ) $method = config('const.crud.create'); $edit = ($method === config('const.crud.update')); $insert = ($method === config('const.crud.create')); @endphp
{{-- # VIEW DATA 'id' => 'categoriesInput', // * FORM ID (UNIQUE NAME) 'resource' => 'categories', // * (DB TABLE NAME) RESOURCE (RESOURCE ID) 'static' => '0', // NOT DINAMIC ALWAYS REFER THE SAME INPUT 'table' => 'categoriesRecord', // (ID) CONNECTED TABLE 'wysihtml5' => true, // WYSIHTML5 SUPPORT 'autoclose' => true // CLOSE MODAL CONTAINER RELATED IF ANY ON SUMBIT (DEFAULT false) # FORM CONFIG FORMAT jQuery(document).ready(function() { // INIT FORM {{ $id }}Form.init({ setup: { components: function(form){ // USE NAME $("#{{ $id }} input[name=name]").on( "change", function(){ Validation.formatFirstWordCapital(event.target); } ); }, successLoad: function(){ console.log('SUCCESS LOAD') }, validate: { rules: { 'name' : { required: true, minlength: 3, }, }, submit: { successUpdate: function(){ console.log('SUCCESS EDIT') }, successInsert: function(){ console.log('SUCCESS INPUT') } } }, } }); }); --}} @push('script') @endpush