This commit is contained in:
Kamil Niemczycki 2022-06-06 11:12:39 +02:00
parent 04d036a1ef
commit 17f5823e98
2 changed files with 5 additions and 5 deletions

View File

@ -183,8 +183,8 @@ class VacationRequestController extends Controller
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class), "createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class),
"skipFlow" => $request->user()->can("skipFlow", VacationRequest::class), "skipFlow" => $request->user()->can("skipFlow", VacationRequest::class),
], ],
"vacationUserId" => $requestData['user'], "vacationUserId" => $requestData["user"],
"vacationFromDate" => $requestData['from_date'], "vacationFromDate" => $requestData["from_date"],
]); ]);
} }

View File

@ -13,7 +13,7 @@ class CreateVacationRequestRequest extends FormRequest
public function authorize(): bool public function authorize(): bool
{ {
return is_null($this->get("user")) || return null === $this->get("user") ||
(int)$this->get("user") === $this->user()->id || (int)$this->get("user") === $this->user()->id ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
} }
@ -29,8 +29,8 @@ class CreateVacationRequestRequest extends FormRequest
public function data(): array public function data(): array
{ {
return [ return [
"user" => (int)$this->get('user'), "user" => (int)$this->get("user"),
"from_date" => $this->get('from_date'), "from_date" => $this->get("from_date"),
]; ];
} }
} }