write me a warner

This commit is contained in:
Mekan1206
2026-02-11 03:15:43 +05:00
parent d3ac6ff8d9
commit e2adf5e9da
6 changed files with 94 additions and 2 deletions

View File

@@ -18,6 +18,9 @@ class Kernel extends ConsoleKernel
// Remove non saved attachments...
$schedule->call(new PruneStaleAttachments)->daily();
// IF any warnings unresolved warnings exists, send notify me
$schedule->call(new WarnDev)->dailyAt('16:00');
}
/**

25
app/Console/WarnDev.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
namespace App\Console;
use App\Models\System\Warning;
use Illuminate\Console\Command;
class WarnDev extends Command
{
/**
* Notify me if any unresolved warnings exists
*
* @return void
*/
public function __invoke()
{
$warnings = Warning::whereNull('resolved_at')->get();
if ($warnings->isEmpty()) {
return;
}
sendSMS('61929248', 'Warnings: '.$warnings->count());
}
}