A lot of things
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Entry;
|
||||
use App\Models\News;
|
||||
use Illuminate\Console\Attributes\Description;
|
||||
use Illuminate\Console\Attributes\Signature;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -20,7 +21,11 @@ class DeleteRejectedEntries extends Command
|
||||
$count = Entry::where('state', 'rejected')
|
||||
->where('rejected_at', '<', now()->subDays($days))
|
||||
->delete();
|
||||
$count += News::where('state', 'rejected')
|
||||
->where('rejected_at', '<', now()->subDays($days))
|
||||
->delete();
|
||||
|
||||
$this->info("Deleted {$count} entries");
|
||||
$this->info("Deleted {$count} entries/news");
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user