ibrahim-bougaoua/filaprogress

这是我包装的filaprogress

资助包维护!
IbrahimBougaoua

安装: 236

依赖: 0

建议者: 0

安全: 0

星标: 3

关注者: 1

分支: 0

开放问题: 0

语言:Blade

v0.1 2024-09-03 21:04 UTC

This package is auto-updated.

Last update: 2024-09-24 12:12:26 UTC


README

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

为 FilamentPHP 提供进度管理包 filaprogress,它提供了一个灵活且易于使用的解决方案,用于在 Filament 管理面板中跟踪和可视化进度。它包括自定义的 Filament 组件,可以直接在您的管理界面中显示线性进度条和圆形进度指示器。此包旨在无缝集成到 Filament 的现有工具中,提供动态可定制的进度条和圆形,以表示任务完成、项目里程碑或任何需要可视化进度跟踪的指标。非常适合通过直观的实时进度显示增强管理仪表板中的用户体验。

YouTube 视频


Total Downloads

安装

您可以通过 composer 安装此包

composer require ibrahim-bougaoua/filaprogress

可选地,您可以使用以下命令发布视图

php artisan vendor:publish --tag="filaprogress-views"

用法

// For infolist
use IbrahimBougaoua\FilaProgress\Infolists\Components\CircleProgressEntry;
use IbrahimBougaoua\FilaProgress\Infolists\Components\ProgressBarEntry;

return $infolist
    ->schema([
        CircleProgressEntry::make('circle')
            ->getStateUsing(function ($record) {
                $total = $record->items()->count();
                $progress = $record->countPaidItems();
                return [
                    'total' => $total,
                    'progress' => $progress,
                ];
            })
            ->hideProgressValue(),
        ProgressBarEntry::make('bar')
            ->getStateUsing(function ($record) {
                $total = $record->items()->count();
                $progress = $record->countPaidItems();
                return [
                    'total' => $total,
                    'progress' => $progress,
                ];
            })
            ->hideProgressValue(),
// For table
use IbrahimBougaoua\FilaProgress\Tables\Columns\CircleProgress;
use IbrahimBougaoua\FilaProgress\Tables\Columns\ProgressBar;

return $table
    ->columns([
        CircleProgress::make('circle')
            ->getStateUsing(function ($record) {
                $total = $record->items()->count();
                $progress = $record->countPaidItems();
                return [
                    'total' => $total,
                    'progress' => $progress,
                ];
            })
            ->hideProgressValue(),
        ProgressBar::make('bar')
            ->getStateUsing(function ($record) {
                $total = $record->items()->count();
                $progress = $record->countPaidItems();
                return [
                    'total' => $total,
                    'progress' => $progress,
                ];
            })
            ->hideProgressValue(),

测试

composer test

安全漏洞

请查看我们的安全策略以了解如何报告安全漏洞。

致谢

许可证

MIT 许可证(MIT)。请参阅许可证文件获取更多信息。