1
0

CRUD Ticket Insidace Type

This commit is contained in:
Wian Drs
2026-06-25 13:06:24 +07:00
parent faab64e0dd
commit ad472a9880
10 changed files with 338 additions and 0 deletions
@@ -0,0 +1,38 @@
<?php
namespace App\Services\Ticket;
use App\Models\TicketIncidentType;
class TicketIncidentTypeService
{
public function getAll()
{
return TicketIncidentType::orderBy('name')->get();
}
public function create(array $data): TicketIncidentType
{
return TicketIncidentType::create([
'name' => $data['name'],
'is_active' => $data['is_active'] ?? true
]);
}
public function update(
TicketIncidentType $ticketIncidentType,
array $data
): TicketIncidentType {
$ticketIncidentType->update([
'name' => $data['name'],
'is_active' => $data['is_active']
]);
return $ticketIncidentType->fresh();
}
public function delete(TicketIncidentType $ticketIncidentType): void
{
$ticketIncidentType->delete();
}
}