public function table(Inventory $item)
    {
        $stocks = $item->stocks();

        return $this->table->of('inventory.stocks', function (TableGrid $table) use ($item, $stocks) {
            $table->with($stocks);

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

            $table->column('quantity');

            $table->column('location', function (Column $column) use ($item) {
                $column->value = function (InventoryStock $stock) use ($item) {
                    $name = $stock->location->trail;

                    return link_to_route('maintenance.inventory.stocks.show', $name, [$item->getKey(), $stock->getKey()]);
                };
            });

            $table->column('last_movement', function (Column $column) {
                $column->value = function (InventoryStock $stock) {
                    return $stock->last_movement;
                };
            });

            $table->column('last_movement_by', function (Column $column) {
                $column->value = function (InventoryStock $stock) {
                    return $stock->last_movement_by;
                };
            });
        });
    }
public function table(Inventory $item)
    {
        $stocks = $item->stocks();

        return $this->table->of('inventory.stocks', function (TableGrid $table) use ($item, $stocks) {
            $table->with($stocks);

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

            $table->column('quantity');

            $table->column('location', function (Column $column) use ($item) {
                $column->value = function (InventoryStock $stock) use ($item) {
                    $name = $stock->location->trail;

                    return link_to_route('maintenance.inventory.stocks.show', $name, [$item->getKey(), $stock->getKey()]);
                };
            });

            $table->column('last_movement', function (Column $column) {
                $column->value = function (InventoryStock $stock) {
                    return $stock->last_movement;
                };
            });

            $table->column('last_movement_by', function (Column $column) {
                $column->value = function (InventoryStock $stock) {
                    return $stock->last_movement_by;
                };
            });
        });
    }
public function table ( Inventory $ item ) { $ stocks = $ item -> stocks ( ) ; return $ this -> table -> of ( 'inventory.stocks' , function ( TableGrid $ table ) use ( $ item , $ stocks ) { $ table -> with ( $ stocks ) ; $ table -> attributes ( [ 'class' => 'table table-hover table-striped' , ] ) ; $ table -> column ( 'quantity' ) ; $ table -> column ( 'location' , function ( Column $ column ) use ( $ item ) { $ column -> value = function ( InventoryStock $ stock ) use ( $ item ) { $ name = $ stock -> location -> trail ; return link_to_route ( 'maintenance.inventory.stocks.show' , $ name , [ $ item -> getKey ( ) , $ stock -> getKey ( ) ] ) ; } ; } ) ; $ table -> column ( 'last_movement' , function ( Column $ column ) { $ column -> value = function ( InventoryStock $ stock ) { return $ stock -> last_movement ; } ; } ) ; $ table -> column ( 'last_movement_by' , function ( Column $ column ) { $ column -> value = function ( InventoryStock $ stock ) { return $ stock -> last_movement_by ; } ; } ) ; } ) ; }
Returns a new table of all stocks of the specified inventory item.

@param Inventory $item

@return \Orchestra\Contracts\Html\Builder
Returns a new table of all stocks of the specified inventory item .