This commit is contained in:
parent
66b2b1ee39
commit
d62fddc907
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\RiwayatDiagnosa;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class DeleteOldRiwayat extends Command
|
||||
{
|
||||
protected $signature = 'riwayat:delete-old';
|
||||
protected $description = 'Hapus riwayat diagnosa yang lebih dari 7 hari';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$cutoffDate = Carbon::now()->subDays(7);
|
||||
$deleted = RiwayatDiagnosa::where('tanggal', '<', $cutoffDate)->delete();
|
||||
|
||||
$this->info("Berhasil menghapus {$deleted} data riwayat yang lebih dari 7 hari.");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('riwayat:delete-old')->daily();
|
||||
}
|
||||
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -11,6 +11,7 @@
|
|||
"concurrently": "^9.0.1",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"postcss": "^8.4.47",
|
||||
"purgecss": "^7.0.2",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"vite": "^6.0.11"
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,6 @@
|
|||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/history.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/homeadmin.css') }}">
|
||||
|
||||
|
||||
<div class="main-banner wow fadeIn " id="diagnosa" data-wow-duration="1s" data-wow-delay="0.5s">
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<button class="btn">Test Button</button>
|
||||
<table class="table"><tr><td>Test</td></tr></table>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue