BEST Offers , For All Sximo 5 LTS licence Holer , Upgrade Licence For only $14 Normal Price on Codecanyon $31
New product Sximopress ( Wordpress Builder ) 1.0 has been realesed . download it now !

S5 Ultimate

The Real PHP Application Makers

Free Role Module

Did you know ? you dont have to always create CRUD using Builder . you can create awesome Complete CRUD with only few line codes .
Follow this tutorial

1.Start Here

First of all we create our function at the controller and register CrudEngine Class . It will have something like this:

Controller sceleton

<?php namespace App\Http\Controllers;
use App\Library\CrudEngine;

class CrudController extends Controller
{
   public function index()
   {

   }
}

Routes

You need to register your new controller . open and edit file routes /routes/web.php and register method/function
Route::get('crud','CrudController@index');
Route::post('crud', 'CrudController@index');

2.Initialize CrudEngine Class

At the begining line code you need to call CrudEngine class in your controller , it can be done by line code as bellow
$crudEngine = new CrudEngine();

3.Retrieving All Rows From A Table

You may use the table method to begin a query. The table method returns a fluent query builder instance for the given table
$crudEngine= new CrudEngine();
$crud = $crudEngine->table('yourTableName')->render()

Example controller

<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Library\CrudEngine;

class CrudController extends Controller
{
    public function index()
    {
           $crudEngine= new CrudEngine();
           $crud = $crudEngine->table('yourTableName')->render()
           
           return view('template',['crud'=>$crud]);
        }

}

4. Render view

Now , create new template view resources/views/template.blade.php and copy file bellow
{!! $crud !!}
That's it . with few step , you have already create complite CRUD function . This is basic usage of how to create crud at laravel using CrudEngine script

Please Register Purchased Code for full access Docs


Last Update : 2017-10-20 03:10:00