PHP Class Encore\Admin\Grid

Datei anzeigen Open project: z-song/laravel-admin Class Usage Examples

Public Properties

Property Type Description
$columnNames array All column names of the grid.

Protected Properties

Property Type Description
$allowActions boolean Allow actions.
$allowBatchDeletion boolean Allow batch allow.
$builded boolean Mark if the grid is builded.
$builder Closure Grid builder.
$columns Illuminate\Support\Collection Collection of all grid columns.
$exporter Encore\Admin\Grid\Exporter
$filter Encore\Admin\Grid\Filter The grid Filter.
$keyName string Default primary key name.
$model Encore\Admin\Grid\Model The grid data model instance.
$resourcePath Resource path of the grid.
$rows Illuminate\Support\Collection Collection of all data rows.
$rowsCallback Closure Rows callable fucntion.
$variables array All variables in grid view.

Public Methods

Method Description
__call ( $method, $arguments ) Dynamically add columns to the grid view.
__construct ( Model $model, Closure $builder ) Create a new grid instance.
__toString ( ) : string Get the string contents of the grid view.
allowActions ( ) : boolean If allow actions.
allowBatchDeletion ( ) : boolean If allow batch delete.
blank ( $label )
build ( ) : void Build the grid.
column ( string $name, string $label = '' ) : Column Add column to Grid.
columns ( array $columns = [] ) : Collection | void Batch add column to grid.
disableActions ( ) Disable all actions.
disableBatchDeletion ( ) Disable batch deletion.
filter ( Closure $callback ) Set the grid filter.
model ( ) : Model Get Grid model.
paginate ( integer $perPage = null ) : void Paginate the grid.
paginator ( ) : mixed Get the grid paginator.
pathOfCreate ( )
render ( ) : string Get the string contents of the grid view.
renderFilter ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Render the grid filter.
resource ( string $path = null ) : string Get current resource uri.
rows ( Closure $callable = null ) : Collection | void Set grid row callback function.
with ( array $variables = [] ) Add variables to grid view.

Protected Methods

Method Description
addColumn ( string $column = '', string $label = '' ) : Column Add column to grid.
buildRows ( array $data ) : void Build the grid rows.
setupExporter ( ) : void Setup grid exporter.
setupFilter ( ) : void Setup grid filter.
variables ( ) : array Get all variables will used in grid view.

Method Details

__call() public method

Dynamically add columns to the grid view.
public __call ( $method, $arguments )
$method
$arguments

__construct() public method

Create a new grid instance.
public __construct ( Model $model, Closure $builder )
$model Illuminate\Database\Eloquent\Model
$builder Closure

__toString() public method

Get the string contents of the grid view.
public __toString ( ) : string
return string

addColumn() protected method

Add column to grid.
protected addColumn ( string $column = '', string $label = '' ) : Column
$column string
$label string
return Encore\Admin\Grid\Column

allowActions() public method

If allow actions.
public allowActions ( ) : boolean
return boolean

allowBatchDeletion() public method

If allow batch delete.
public allowBatchDeletion ( ) : boolean
return boolean

blank() public method

public blank ( $label )

build() public method

Build the grid.
public build ( ) : void
return void

buildRows() protected method

Build the grid rows.
protected buildRows ( array $data ) : void
$data array
return void

column() public method

Add column to Grid.
public column ( string $name, string $label = '' ) : Column
$name string
$label string
return Encore\Admin\Grid\Column

columns() public method

Batch add column to grid.
public columns ( array $columns = [] ) : Collection | void
$columns array
return Illuminate\Support\Collection | void

disableActions() public method

Disable all actions.
public disableActions ( )

disableBatchDeletion() public method

Disable batch deletion.

filter() public method

Set the grid filter.
public filter ( Closure $callback )
$callback Closure

model() public method

Get Grid model.
public model ( ) : Model
return Encore\Admin\Grid\Model

paginate() public method

Paginate the grid.
public paginate ( integer $perPage = null ) : void
$perPage integer
return void

paginator() public method

Get the grid paginator.
public paginator ( ) : mixed
return mixed

pathOfCreate() public method

public pathOfCreate ( )

render() public method

Get the string contents of the grid view.
public render ( ) : string
return string

renderFilter() public method

Render the grid filter.
public renderFilter ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

resource() public method

Get current resource uri.
public resource ( string $path = null ) : string
$path string
return string

rows() public method

Set grid row callback function.
public rows ( Closure $callable = null ) : Collection | void
$callable Closure
return Illuminate\Support\Collection | void

setupExporter() protected method

Setup grid exporter.
protected setupExporter ( ) : void
return void

setupFilter() protected method

Setup grid filter.
protected setupFilter ( ) : void
return void

variables() protected method

Get all variables will used in grid view.
protected variables ( ) : array
return array

with() public method

Add variables to grid view.
public with ( array $variables = [] )
$variables array

Property Details

$allowActions protected_oe property

Allow actions.
protected bool $allowActions
return boolean

$allowBatchDeletion protected_oe property

Allow batch allow.
protected bool $allowBatchDeletion
return boolean

$builded protected_oe property

Mark if the grid is builded.
protected bool $builded
return boolean

$builder protected_oe property

Grid builder.
protected Closure $builder
return Closure

$columnNames public_oe property

All column names of the grid.
public array $columnNames
return array

$columns protected_oe property

Collection of all grid columns.
protected Collection,Illuminate\Support $columns
return Illuminate\Support\Collection

$exporter protected_oe property

protected Exporter,Encore\Admin\Grid $exporter
return Encore\Admin\Grid\Exporter

$filter protected_oe property

The grid Filter.
protected Filter,Encore\Admin\Grid $filter
return Encore\Admin\Grid\Filter

$keyName protected_oe property

Default primary key name.
protected string $keyName
return string

$model protected_oe property

The grid data model instance.
protected Model,Encore\Admin\Grid $model
return Encore\Admin\Grid\Model

$resourcePath protected_oe property

Resource path of the grid.
protected $resourcePath

$rows protected_oe property

Collection of all data rows.
protected Collection,Illuminate\Support $rows
return Illuminate\Support\Collection

$rowsCallback protected_oe property

Rows callable fucntion.
protected Closure $rowsCallback
return Closure

$variables protected_oe property

All variables in grid view.
protected array $variables
return array