feat: ticket views, statuses, participants, merge; mobile layout fixes (#5)
- New migrations: ticket views, statuses, participants, merge support - New models: TicketView, TicketStatus, TicketParticipant - New seeder: EmailTemplatesSeeder - Console commands for ticketing - Mobile: sidebar min-w-0/overflow-hidden, tab nav overflow-x-auto Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
33
src/Console/Commands/AutoCloseTickets.php
Normal file
33
src/Console/Commands/AutoCloseTickets.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Dashboard\Ticketing\Console\Commands;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Dashboard\Ticketing\Models\Ticket;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class AutoCloseTickets extends Command
|
||||
{
|
||||
protected $signature = 'ticketing:auto-close';
|
||||
protected $description = 'Close resolved tickets that have not been updated within the configured grace period.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$days = (int) Setting::get('ticketing.auto_close_days', 0);
|
||||
|
||||
if ($days <= 0) {
|
||||
$this->info('Auto-close is disabled (ticketing.auto_close_days = 0).');
|
||||
return 0;
|
||||
}
|
||||
|
||||
$cutoff = now()->subDays($days);
|
||||
|
||||
$count = Ticket::where('status', 'resolved')
|
||||
->where('updated_at', '<=', $cutoff)
|
||||
->update(['status' => 'closed']);
|
||||
|
||||
$this->info("Auto-closed {$count} ticket(s) resolved more than {$days} day(s) ago.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user