soluzione-software/nova-resource-table-footer

Nova resource table footer

0.2.2 2021-03-29 08:18 UTC

This package is auto-updated.

Last update: 2024-11-29 06:10:51 UTC


README

Latest Version MIT License

Note the package is currently in beta. During the beta period things can and probably will change. Don't use it in production until a stable version has been released. We appreciate you helping out with testing and reporting any bugs.

The package allows to customize the footer(rows and columns) in Nova Resource table.

Installation & Configuration

composer require soluzione-software/nova-resource-table-footer
<?php

namespace App\Nova;

use Illuminate\Database\Eloquent\Builder;
use Laravel\Nova\Http\Requests\NovaRequest;
use SoluzioneSoftware\NovaResourceTableFooter\Contracts\HasFooter;

class User extends Resource implements HasFooter {
    // ...
    
    public function getFooter(NovaRequest $request, Builder $query): array
    {
        return [ // <tfoot>
            [ // <tr>
                [ // <td> 
                    'attributes' => [ // <td ... v-bind="attributes">
                        'colspan' => 5,
                        //'rowspan' => 1,
                     ],
                    'content' => '<span>...</span>', // html content
                 ], // </td>
            ], // </tr>
        ]; // </tfoot>
    }
}