Implement tenant announcements and audit log fixes
This commit is contained in:
40
app/Console/Commands/DispatchTenantAnnouncements.php
Normal file
40
app/Console/Commands/DispatchTenantAnnouncements.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\TenantAnnouncements\TenantAnnouncementService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class DispatchTenantAnnouncements extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'tenant-announcements:dispatch';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Dispatch scheduled tenant announcements and queue email notifications';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(TenantAnnouncementService $service): int
|
||||
{
|
||||
$result = $service->process();
|
||||
|
||||
$this->info(sprintf(
|
||||
'Announcements: %d activated, %d archived, %d emails queued.',
|
||||
$result['activated'],
|
||||
$result['archived'],
|
||||
$result['queued'],
|
||||
));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user