public function tableHistory($for, MorphMany $revisions)
    {
        return $this->table->of("$for.revisions", function (TableGrid $table) use ($revisions) {
            $table->with($revisions)->paginate($this->perPage);

            $table->pageName = 'history';

            $table->column('user_responsible', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $user = $revision->getUserResponsible();

                    if ($user instanceof User) {
                        return $user->getRecipientName();
                    }

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

            $table->column('changed', function (Column $column) {
                $column->value = function (Revision $revision) {
                    return $revision->getColumnName();
                };
            });

            $table->column('from', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $old = $revision->getOldValue();

                    if (is_null($old)) {
                        return HTML::create('em', 'None');
                    }

                    return $old;
                };
            });

            $table->column('to', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $new = $revision->getNewValue();

                    if (is_null($new)) {
                        return HTML::create('em', 'None');
                    }

                    return $new;
                };
            });

            $table->column('On', 'created_at');
        });
    }
public function tableHistory($for, MorphMany $revisions)
    {
        return $this->table->of("$for.revisions", function (TableGrid $table) use ($revisions) {
            $table->with($revisions)->paginate($this->perPage);

            $table->pageName = 'history';

            $table->column('user_responsible', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $user = $revision->getUserResponsible();

                    if ($user instanceof User) {
                        return $user->getRecipientName();
                    }

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

            $table->column('changed', function (Column $column) {
                $column->value = function (Revision $revision) {
                    return $revision->getColumnName();
                };
            });

            $table->column('from', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $old = $revision->getOldValue();

                    if (is_null($old)) {
                        return HTML::create('em', 'None');
                    }

                    return $old;
                };
            });

            $table->column('to', function (Column $column) {
                $column->value = function (Revision $revision) {
                    $new = $revision->getNewValue();

                    if (is_null($new)) {
                        return HTML::create('em', 'None');
                    }

                    return $new;
                };
            });

            $table->column('On', 'created_at');
        });
    }
public function tableHistory ( $ for , MorphMany $ revisions ) { return $ this -> table -> of ( "$for.revisions" , function ( TableGrid $ table ) use ( $ revisions ) { $ table -> with ( $ revisions ) -> paginate ( $ this -> perPage ) ; $ table -> pageName = 'history' ; $ table -> column ( 'user_responsible' , function ( Column $ column ) { $ column -> value = function ( Revision $ revision ) { $ user = $ revision -> getUserResponsible ( ) ; if ( $ user instanceof User ) { return $ user -> getRecipientName ( ) ; } return HTML :: create ( 'em' , 'None' ) ; } ; } ) ; $ table -> column ( 'changed' , function ( Column $ column ) { $ column -> value = function ( Revision $ revision ) { return $ revision -> getColumnName ( ) ; } ; } ) ; $ table -> column ( 'from' , function ( Column $ column ) { $ column -> value = function ( Revision $ revision ) { $ old = $ revision -> getOldValue ( ) ; if ( is_null ( $ old ) ) { return HTML :: create ( 'em' , 'None' ) ; } return $ old ; } ; } ) ; $ table -> column ( 'to' , function ( Column $ column ) { $ column -> value = function ( Revision $ revision ) { $ new = $ revision -> getNewValue ( ) ; if ( is_null ( $ new ) ) { return HTML :: create ( 'em' , 'None' ) ; } return $ new ; } ; } ) ; $ table -> column ( 'On' , 'created_at' ) ; } ) ; }
Returns a new table of all revisions.

@param string    $for
@param MorphMany $revisions

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