PHP code example of ryangjchandler / filament-progress-column
1. Go to this page and download the library: Download ryangjchandler/filament-progress-column library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ryangjchandler / filament-progress-column example snippets
use RyanChandler\FilamentProgressColumn\ProgressColumn;
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress'),
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')
->progress(function ($record) {
return ($record->rows_complete / $record->total_rows) * 100;
}),
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')
->poll('5s')
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')
->poll(function ($record) {
return $record->progress < 100 ? '5s' : null;
})
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')
->color('warning'),
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')
->color('bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500'),
];
}
protected function getTableColumns(): array
{
return [
ProgressColumn::make('progress')->color(function ($record){
return $record->progress > 50 ? 'primary' : 'success';
})
];
}
bash
php artisan vendor:publish --tag="filament-progress-column-views"