marshmallow / nova-totals-footer
This Laravel Nova package is used for calculating the total of the columns that you wish to show.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^8.1
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- laravel/nova: ^5.0
- laravel/nova-devtool: ^1.2
This package is auto-updated.
Last update: 2025-02-08 10:43:49 UTC
README
Laravel Nova Totals footer
This Laravel Nova package is used for calculating the total of the columns that you wish to show.
Screenshot
Requirements
php: ^8.1
laravel/nova: ^5.0
Installation
Install via composer:
composer require marshmallow/nova-totals-footer
Usage
To include specific fields in the table footer, invoke their respective calculate
methods. Within this method, specify the calculation logic to determine the desired value. By default, the available calculation methods include sum
, count
, avg
, min
and max
. Refer to the example below for further clarification.
Currency::make('Revenue', 'revenue') ->required() /** 👇 This is where the magic happens */ ->calculate( method: 'sum', // sum, count, avg, min and max title: 'Total', prefix: '$', postfix: '.00', hideTitle: true, // true, false (default) align: 'right', // left, right (default), center titleAlign: 'right', // left, right (default), center ),
Hide the header off footer
This sound weird, but sometimes we needed to hide the header of the footer. We didn't need this extra footer row. Is you need to hide this, you can call the method below.
use Marshmallow\NovaTotalsFooter\NovaTotalsFooter; NovaTotalsFooter::hideHeader();
Licence
The MIT License (MIT). Please see License File for more information.
💖 Sponsorships
If you are reliant on this package in your production applications, consider sponsoring us! It is the best way to help us keep doing what we love to do: making great open source software.
Contributing
Feel free to suggest changes, ask for new features or fix bugs yourself. We're sure there are still a lot of improvements that could be made, and we would be very happy to merge useful pull requests.
Special thanks to
Made with ❤️ for open source
At Marshmallow we use a lot of open source software as part of our daily work. So when we have an opportunity to give something back, we're super excited!
We hope you will enjoy this small contribution from us and would love to hear from you if you find it useful in your projects. Follow us on Twitter for more updates!