added jquery and also fixed fontawsome
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Helpdesk\Services;
|
||||
|
||||
use Modules\Helpdesk\Models\Ticket;
|
||||
|
||||
final class TicketReferenceService
|
||||
{
|
||||
/**
|
||||
* Build the next human-readable ticket reference.
|
||||
*/
|
||||
public function next(): string
|
||||
{
|
||||
$year = now()->format('Y');
|
||||
$prefix = 'HD-'.$year.'-';
|
||||
$last = Ticket::query()
|
||||
->where('reference', 'like', $prefix.'%')
|
||||
->latest('id')
|
||||
->value('reference');
|
||||
|
||||
$next = $last ? ((int) substr((string) $last, -5)) + 1 : 1;
|
||||
|
||||
return $prefix.str_pad((string) $next, 5, '0', STR_PAD_LEFT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user