public function table($workOrder)
    {
        return $this->table->of('work-orders', function (TableGrid $table) use ($workOrder) {
            $table->with($workOrder)->paginate($this->perPage);

            $table->attributes([
                'class' => 'table table-hover table-striped',
            ]);

            $table->column('ID', 'id');

            $table->column('subject', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    return link_to_route('maintenance.work-orders.show', $workOrder->subject, [$workOrder->getKey()]);
                };
            });

            $table->column('Created At', 'created_at');

            $table->column('created_by', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    return $workOrder->user->fullname;
                };
            });

            $table->column('priority', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    if ($workOrder->priority instanceof Priority) {
                        return $workOrder->priority->getLabel();
                    }

                    return HTML::create('em', 'None');
                };
            });

            $table->column('status', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    if ($workOrder->status instanceof Status) {
                        return $workOrder->status->getLabel();
                    }

                    return HTML::create('em', 'None');
                };
            });
        });
    }
public function table($workOrder)
    {
        return $this->table->of('work-orders', function (TableGrid $table) use ($workOrder) {
            $table->with($workOrder)->paginate($this->perPage);

            $table->attributes([
                'class' => 'table table-hover table-striped',
            ]);

            $table->column('ID', 'id');

            $table->column('subject', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    return link_to_route('maintenance.work-orders.show', $workOrder->subject, [$workOrder->getKey()]);
                };
            });

            $table->column('Created At', 'created_at');

            $table->column('created_by', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    return $workOrder->user->fullname;
                };
            });

            $table->column('priority', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    if ($workOrder->priority instanceof Priority) {
                        return $workOrder->priority->getLabel();
                    }

                    return HTML::create('em', 'None');
                };
            });

            $table->column('status', function (Column $column) {
                $column->value = function (WorkOrder $workOrder) {
                    if ($workOrder->status instanceof Status) {
                        return $workOrder->status->getLabel();
                    }

                    return HTML::create('em', 'None');
                };
            });
        });
    }
public function table ( $ workOrder ) { return $ this -> table -> of ( 'work-orders' , function ( TableGrid $ table ) use ( $ workOrder ) { $ table -> with ( $ workOrder ) -> paginate ( $ this -> perPage ) ; $ table -> attributes ( [ 'class' => 'table table-hover table-striped' , ] ) ; $ table -> column ( 'ID' , 'id' ) ; $ table -> column ( 'subject' , function ( Column $ column ) { $ column -> value = function ( WorkOrder $ workOrder ) { return link_to_route ( 'maintenance.work-orders.show' , $ workOrder -> subject , [ $ workOrder -> getKey ( ) ] ) ; } ; } ) ; $ table -> column ( 'Created At' , 'created_at' ) ; $ table -> column ( 'created_by' , function ( Column $ column ) { $ column -> value = function ( WorkOrder $ workOrder ) { return $ workOrder -> user -> fullname ; } ; } ) ; $ table -> column ( 'priority' , function ( Column $ column ) { $ column -> value = function ( WorkOrder $ workOrder ) { if ( $ workOrder -> priority instanceof Priority ) { return $ workOrder -> priority -> getLabel ( ) ; } return HTML :: create ( 'em' , 'None' ) ; } ; } ) ; $ table -> column ( 'status' , function ( Column $ column ) { $ column -> value = function ( WorkOrder $ workOrder ) { if ( $ workOrder -> status instanceof Status ) { return $ workOrder -> status -> getLabel ( ) ; } return HTML :: create ( 'em' , 'None' ) ; } ; } ) ; } ) ; }
Returns a new table of all work orders.

@param WorkOrder|Builder $workOrder

@return \Orchestra\Contracts\Html\Builder
Returns a new table of all work orders .