2017 © Pedro Peláez
 

library louislam-crud

An easy-to-use CRUD library for you to create a back-end system or RESTful API in a few minutes.

image

louislam/louislam-crud

An easy-to-use CRUD library for you to create a back-end system or RESTful API in a few minutes.

  • Wednesday, July 25, 2018
  • by louislam
  • Repository
  • 6 Watchers
  • 12 Stars
  • 630 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 53 Versions
  • 4 % Grown

The README.md

Louis Lam's CRUD

Features

  • "Write Less, Do More".
  • Create/Update/Delete/ListView web interface.
  • RESTful API.
  • Auto create tables and fields for you.
  • Extensible Field Types.
  • Theme
  • Work without any framework. (But work better with Slim Framework by default)
  • Export to Excel format (Customizable)
  • Support MySQL/MariaDB, SQLite, PostgreSQL and CUBRID.

Docmentation

https://github.com/louislam/louislam-crud/wiki, (*1)

Installation

Note: The library is under development and not tested very well currently., (*2)

Method 1: add louislam-crud to your composer.json

  1. Require the library., (*3)

    "require": {
        "louislam/louislam-crud": "1.0.*"
    }
    
  2. Compose the project with PHP Composer., (*4)

Method 2: Start a new project with bootstrap project.

  1. Download bootstrap project from: https://github.com/louislam/louislam-crud-bootstrap
  2. Compose the project with PHP Composer.

Method 3: Direct Download without Composer (Coming Soon)

Getting started with a simple example

  1. Require and Import Libraries., (*5)

    <?php
    
    require "vendor/autoload.php";
    use LouisLam\CRUD\SlimLouisCRUD;
    use RedBeanPHP\R;
    
  2. Setup a Database Connection (Support MySQL, SQLite etc.), (*6)

    For SQLite:, (*7)

    R::setup('sqlite:dbfile.db');
    

    For MySQL:, (*8)

    R::setup( 'mysql:host=localhost;dbname=mydatabase', 'user', 'password' );
    

    More info: http://www.redbeanphp.com/index.php?p=/connection, (*9)

  3. Create a SlimLouisCRUD instance., (*10)

    $crud = new SlimLouisCRUD();
    
  4. Add a route for your table (product)., (*11)

    // Add a Route for "product" table
    $crud->add("product", function () use ($crud) {
    
        // Show and Ordering the fields
        $crud->showFields([
            "id", 
            "name", 
            "price", 
            "description"
        ]);
    
    });
    
  5. Run the application., (*12)

    $crud->run();
    
  6. Open it in your browser., (*13)

    http://<your hostname>/index.php/crud/product
    

    Alt screenshot, (*14)

The Versions