Skip to content

chamra/laraCRUDJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

LaraCURDJS

JavaScript Helper library for laravel CRUD functions

Installation

  1. Download zip file and unzip it
  2. place the laraCRUD.js file inside you acceset folder.
  3. create new object from CRUD class which is in the laraCRUD.js.
  4. Call the methods initCRUDFunctions() to initiate curd function or initDataTables() to initiate datatables.

Usage

  • create a object from the CRUD class
    example - crud = new CRUD()

  • provide the object with data to initiate crud function to the method.
    example -
    const crudInit = { url : url, modal : '#formModal', refreshPage : false, form: 'formData', //should pass the id with out # submitButton: '#btnSubmit', }

  • call the initCRUDFunctions(crudInit) by passing the crudInit

  • LaraCURD prodives methods like crud.onclickAdd() , crud.onClickEdit(id, btn) , crud.onClickDelete(id, btn) which can be called in buttons' onclick.

the form should be in a modal

  • datatables can be initiate by calling initDataTables() method and passing the option object.

Extenral Libraries used


axios
jquery
Notify.js
Datatables

DEV Post