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,39 @@
<?php
namespace App\Http\Requests\TicketIncidentType;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class StoreTicketIncidentTypeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => [
'required',
'string',
'max:255',
'unique:ticket_incident_types,name'
],
'is_active' => [
'sometimes',
'boolean'
]
];
}
}
@@ -0,0 +1,40 @@
<?php
namespace App\Http\Requests\TicketIncidentType;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateTicketIncidentTypeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => [
'required',
'string',
'max:255',
Rule::unique('ticket_incident_types', 'name')
->ignore($this->route('ticketIncidentType'))
],
'is_active' => [
'required',
'boolean'
]
];
}
}