feat: initialize Dr-Panel project with patient file number support
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Exports;
|
||||
|
||||
use Filament\Actions\Exports\ExportColumn;
|
||||
use Filament\Actions\Exports\Exporter;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
use Illuminate\Support\Number;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class RoleExporter extends Exporter
|
||||
{
|
||||
protected static ?string $model = Role::class;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
return [
|
||||
ExportColumn::make('id')
|
||||
->label('ID'),
|
||||
ExportColumn::make('name')
|
||||
->label(__('filament-shield::filament-shield.column.name')),
|
||||
ExportColumn::make('guard_name')
|
||||
->label(__('filament-shield::filament-shield.column.guard_name')),
|
||||
ExportColumn::make('permissions_count')
|
||||
->label(__('filament-shield::filament-shield.column.permissions'))
|
||||
->counts('permissions'),
|
||||
ExportColumn::make('updated_at')
|
||||
->label(__('filament-shield::filament-shield.column.updated_at')),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your role export has completed and ' . Number::format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' ' . Number::format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user