feat(tickets): group user tickets by event
This commit is contained in:
30
app/Domains/Ticketing/Ticket/Requests/ListTicketsRequest.php
Normal file
30
app/Domains/Ticketing/Ticket/Requests/ListTicketsRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Ticketing\Ticket\Requests;
|
||||
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class ListTicketsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function rules(): array
|
||||
{
|
||||
/** @var Tenant $tenant */
|
||||
$tenant = $this->route('tenant');
|
||||
|
||||
return [
|
||||
'event_id' => [
|
||||
'sometimes',
|
||||
'integer',
|
||||
Rule::exists('events', 'id')->where('tenant_code', $tenant->codigo),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user