PHP code example of fatrex / filament-queue-tracker
1. Go to this page and download the library: Download fatrex/filament-queue-tracker 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/ */
namespace App\Models;
use \Fatrex\FilamentQueueTracker\Models\QueueMonitor as FatrexQueueMonitor;
class MyQueueMonitor extends FatrexQueueMonitor {}
use \Fatrex\FilamentQueueTracker\FilamentQueueTrackerPlugin;
...
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentQueueTrackerPlugin::make()
]);
}
public static function table(Table $table): Table
{
return $table
// rest of your code
...
->bulkActions([
BulkAction::make('export-jobs')
->label('Background Export')
->icon('heroicon-o-cog')
->action(function (Collection $records) {
UsersCsvExportJob::dispatch($records, 'users.csv');
Notification::make()
->title('Export is ready')
->body('Your export is ready. You can download it from the exports page.')
->success()
->seconds(5)
->icon('heroicon-o-inbox-in')
->send();
})
])
}