share-lt/app/Console/Commands/SendPreviewSiteBuiltNotification.php

39 lines
964 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Console\Commands;
use App\Events\PreviewSiteBuilt;
use Illuminate\Console\Command;
class SendPreviewSiteBuiltNotification extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test:preview-site-built {--message=Preview site is built}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Send a test notification that the preview site is built';
/**
* Execute the console command.
*/
public function handle(): void
{
$message = $this->option('message');
$this->info("Command :: Broadcasting preview site built notification: {$message}");
PreviewSiteBuilt::dispatch($message, 'success');
$this->info('Notification broadcasted successfully!');
$this->info('Check your Filament admin panel for the toast notification.');
}
}