PHP code example of bewarhizirvan / laravel-grid

1. Go to this page and download the library: Download bewarhizirvan/laravel-grid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bewarhizirvan / laravel-grid example snippets


$grid = new \BewarHizirvan\LaravelGrid\LaravelGrid($parameters);

$grid->setProvider($provider);  
$grid->setLabelButton($label = 'New', $route = '');
$grid->orderBy($col,$dir);
$grid->setTotal($count);
$grid->setIPsortable($name);
$grid->addColumn($name = 'id', $label = 'id',$filter = false, $sortable = false, $ValueCalculator = null, $ValueFormatter = null);
$grid->addFilter($name = 'id', $label = 'id', $operator = 'like', $options = null);
$grid->addFilterSelect($name = 'id', $label = 'id', $options = []);
$grid->addActionColumn($col = 'id', $active = false, $inverse = false);
$grid->addActionButton($type = 'default', $title='', $route = '/', $conditions = [], $colid = null);

$grid = $grid->render();

\BewarHizirvan\LaravelGrid\LaravelGrid::addContextMenu($value = '', $title = ['name'=>'','value'=>''], $rows = [], $right=false);

\BewarHizirvan\LaravelGrid\LaravelGrid::PARENT;
\BewarHizirvan\LaravelGrid\LaravelGrid::SUBMENU;
\BewarHizirvan\LaravelGrid\LaravelGrid::OK;
\BewarHizirvan\LaravelGrid\LaravelGrid::NOTOK;
\BewarHizirvan\LaravelGrid\LaravelGrid::ENABLED;
\BewarHizirvan\LaravelGrid\LaravelGrid::DISABLED;