13 lines
851 B
PHP
13 lines
851 B
PHP
<?php declare(strict_types=1);
|
|
namespace App\Http\Requests\Reporting;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use App\Domain\SchoolCore\Reporting\DTO\ReportRequestData;
|
|
|
|
final class RunReportRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool { return true; }
|
|
public function rules(): array { return ['report_key' => ['required','string'], 'filters' => ['sometimes','array'], 'columns' => ['sometimes','array']]; }
|
|
public function toDTO(): ReportRequestData { return new ReportRequestData((string) $this->input('report_key'), $this->input('filters', []), $this->input('columns'), $this->input('sorts'), $this->input('page'), $this->input('per_page'), (bool) $this->input('include_totals', false), $this->input('timezone'), $this->input('locale'), (bool) $this->input('snapshot', false), $this->input('metadata', [])); }
|
|
}
|