PHP code example of croustibat / filament-jobs-monitor
1. Go to this page and download the library: Download croustibat/filament-jobs-monitor 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/ */
croustibat / filament-jobs-monitor example snippets
namespace App\Models;
use \Croustibat\FilamentJobsMonitor\Models\QueueMonitor as CroustibatQueueMonitor;
class MyQueueMonitor extends CroustibatQueueMonitor {}
use \Croustibat\FilamentJobsMonitor\FilamentJobsMonitorPlugin;
...
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentJobsMonitorPlugin::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();
})
])
}