Add a progress bar column to your Filament tables.

Overview

Add a progress bar column to your Filament tables.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a ProgessColumn that can be used to display a progress bar in a Filament table.

Installation

You can install the package via Composer:

composer require ryangjchandler/filament-progress-column

If you're not using the filament/admin package, you should also add the following line to the top of your CSS:

@import '../../vendor/ryangjchandler/filament-progress-column/resources/dist/progress.css'

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-progress-column-views"

Usage

Add the ProgressColumn to your table:

use RyanChandler\FilamentProgressColumn\ProgressColumn;

protected function getTableColumns(): array
{
    return [
        ProgressColumn::make('progress'),
    ];
}

This will render a progress bar and used the value of $record->progress as the current progress.

Dynamic progress calculation

If you wish to calculate the progress dynamically, provide a Closure to the ProgressColumn::progress() method.

protected function getTableColumns(): array
{
    return [
        ProgressColumn::make('progress')
            ->progress(function ($record) {
                return ($record->rows_complete / $record->total_rows) * 100;
            }),
    ];
}

Polling

If you would like your progress bar to update after a period of time, call the ProgressBar::poll() method and provide a valid modifier string for the wire:poll directive.

protected function getTableColumns(): array
{
    return [
        ProgressColumn::make('progress')
            ->poll('5s')
    ];
}

This will result in a wire:poll.5s directive being added to the column and the value of your progress bar will update every 5 seconds.

Dynamic polling

There might be scenarios where you only want to poll if some condition is met. This can be achieved by returning ?string from a Closure.

protected function getTableColumns(): array
{
    return [
        ProgressColumn::make('progress')
            ->poll(function ($record) {
                return $record->progress < 100 ? '5s' : null;
            })
    ];
}

Now the progress bar will only be updated every 5 seconds if the progress is less than 100.

Colors

By default, the progress bar will be the same as your primary color. If you wish to change this, provide a new string to ProgressBar::color().

protected function getTableColumns(): array
{
    return [
        ProgressColumn::make('progress')
            ->color('warning'),
    ];
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
Releases(v0.3.1)
  • v0.3.1(Jun 29, 2022)

    What's Changed

    • allow additional tailwind colors by @simonbuehler in https://github.com/ryangjchandler/filament-progress-column/pull/5

    Full Changelog: https://github.com/ryangjchandler/filament-progress-column/compare/v0.3.0...v0.3.1

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jun 27, 2022)

    What's Changed

    • Update README.md by @Sicklou in https://github.com/ryangjchandler/filament-progress-column/pull/3
    • add Color callback by @simonbuehler in https://github.com/ryangjchandler/filament-progress-column/pull/4

    New Contributors

    • @Sicklou made their first contribution in https://github.com/ryangjchandler/filament-progress-column/pull/3
    • @simonbuehler made their first contribution in https://github.com/ryangjchandler/filament-progress-column/pull/4

    Full Changelog: https://github.com/ryangjchandler/filament-progress-column/compare/v0.2.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 29, 2022)

    What's Changed

    • feature: polling by @ryangjchandler in https://github.com/ryangjchandler/filament-progress-column/pull/2

    New Contributors

    • @ryangjchandler made their first contribution in https://github.com/ryangjchandler/filament-progress-column/pull/2

    Full Changelog: https://github.com/ryangjchandler/filament-progress-column/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(May 29, 2022)

Owner
Ryan Chandler
Ryan Chandler
Add a general-purpose tools page to your Filament project. 🛠

Add a general-purpose tools page to your Filament project. Installation You can install the package via Composer: composer require ryangjchandler/fila

Ryan Chandler 24 Dec 6, 2022
A laravel package to generate model hashid based on model id column.

Laravel Model Hashid A package to generate model hash id from the model auto increment id for laravel models Installation Require the package using co

Touhidur Rahman 13 Jan 20, 2022
Column sorting with Laravel 8 & 9 - Eloquent sortable

Column sorting for Laravel - Sortable - Sort by Larasort : Column sorting for Laravel - Sort easily Introduction - Larasort package This package allow

Stephen Damian - Laravel Developer 11 Sep 20, 2022
Easily add Laravel Telescope and Horizon to Filament admin panel.

Filament Debugger This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You can inst

Stephen Jude 5 Nov 24, 2022
Quickly generate pivot tables for your projects

Laravel Pivot Table Generator Quickly generate pivot tables for your projects! Table of Contents Installation Usage More generator packages Contributi

Tim Wassenburg 5 May 30, 2022
Effortlessly streamline tables and records printing in PDF/XLSX in your FilamentPHP application.

Filament Printables: a package to generate reports and form printables for your app. This is a work in progress thing Installation You can install the

fastOFI Corp 6 Jun 15, 2023
Belich Tables: a datatable package for Laravel Livewire

Belich Tables is a Laravel package base on Livewire and AlpineJS that allows you to create scaffold datatables with search, column sort, filters, pagination, etc...

Damián Aguilar 11 Aug 26, 2022
Laravel Debugbar (Integrates PHP Debug Bar)

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

Barry vd. Heuvel 14.7k Dec 30, 2022
Make Laravel Pivot Tables using the new Laravel 9 closure migration format

This will allow you to create pivot table migration files using the new Laravel 9 closure migration format by simply passing two models.

Jose Jimenez 16 Aug 23, 2022
Specify the tables that you don't want to drop during refreshing the database.

Custom Fresh Custom Fresh allows fine-grain control of migrations inside your Laravel project. You can choose which tables will not be dropped during

Mahmoud Mohamed Ramadan 7 Jul 25, 2022
Easily interact and control your feature flags from Filament

Easily interact and control your feature flags from Filament

Ryan Chandler 32 Nov 29, 2022
Manage your own workflows with filament

Filament Workflow Manager This package provides a Filament resource where you can configure and manager your workflows, and also provides some functio

EL OUFIR Hatim 41 Jan 2, 2023
Filament Plugin to help implement Cloudflare turnstile into your forms.

Filament Turnstile Filament Turnstile, is a plugin to help you implement the Cloudflare turnstile. This plugin uses Laravel Turnstile Behind the scene

Coderflex 5 Jun 12, 2023
A simple profile management page for Filament. ✨

A simple profile page for Filament. This package provides a very simple Profile page that allows the current user to manage their name, email address

Ryan Chandler 65 Jan 5, 2023
The Most Popular JavaScript Calendar as a Filament Widget 💛

The Most Popular JavaScript Calendar as a Filament Widget ?? Features Accepts all configurations from FullCalendar Event click and drop events Upcomin

Guilherme Saade 62 Dec 31, 2022
A single-field repeater for Filament. ⚡️

A single-field repeater for Filament. This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Insta

Ryan Chandler 3 Mar 5, 2022
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Ralph J. Smit 39 Dec 21, 2022
Admin user, role and permission management for Laravel Filament

Filament Access Control Opinionated setup for managing admin users, roles and permissions within Laravel Filament Features Separate database table for

Elisha Witte 69 Jan 4, 2023
Build structured navigation menus in Filament.

Build structured navigation menus in Filament. This plugin for Filament provides a Navigation resource that allows to build structural navigation menu

Ryan Chandler 61 Dec 30, 2022