ldc-supportweb/app/Http/Requests/Bo/LinkTicket.php
2025-04-08 14:09:22 +02:00

36 lines
723 B
PHP

<?php
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
class LinkTicket extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
$ticket = $this->route('ticket');
return [
'linked_ticket_id' => [
'required',
'numeric',
'exists:tickets,id',
'not_in:' . $ticket->id,
]
];
}
}