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

Controller

All generated controller will have same structure .
 <?php namespace App\Http\Controllers;

use App\Models\Sample;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Validator, Input, Redirect ; 


class SampleController extends Controller {

    protected $layout = "layouts.main";
    protected $data = array();    
    public $module = 'sample';
    static $per_page    = '10';

    public function __construct()
    {
         parent::__construct();
        $this->model = new Sample();
        $this->crudengine = new CrudEngine();
        $this->config = $this->model->connector( $this->module);
        $this->data = array(
            'module'    => $this->module ,
            'title'        => $this->config['title'],
            'note'        => $this->config['note']
        );                   
    }

     public function index( Request $request )
    {
        // Make Sure users Logged 
        if(!\Auth::check()) 
            return redirect('user/login')->with('msgstatus', 'error')->with('messagetext','You are not login');

        $access = $this->model->getAccess( $this->config['id'] , session('gid') );
        if(!in_array('list',$access))
            return redirect('dashboard')->with('status', 'error')->with('message','You dont Have access to the page !');
            
        $table     = $this->crudengine->table( $this->config['table'])
                    ->builder( $this->config )    
                    ->button( implode(',',$access) )
                    ->theme('datatable')
                    ->render();

        $this->data['table'] = $table ;        
        return view('sample.index',$this->data);
    }
}

Please Register Purchased Code for full access Docs


Last Update : 2017-10-11 06:10:30