#157 - more interactive calendar #162
@@ -28,7 +28,6 @@ use Toby\Domain\VacationTypeConfigRetriever;
|
|||||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||||
use Toby\Eloquent\Models\User;
|
use Toby\Eloquent\Models\User;
|
||||||
use Toby\Eloquent\Models\VacationRequest;
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
use Toby\Infrastructure\Http\Requests\CreateVacationRequestRequest;
|
|
||||||
use Toby\Infrastructure\Http\Requests\VacationRequestRequest;
|
use Toby\Infrastructure\Http\Requests\VacationRequestRequest;
|
||||||
use Toby\Infrastructure\Http\Resources\SimpleUserResource;
|
use Toby\Infrastructure\Http\Resources\SimpleUserResource;
|
||||||
use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource;
|
use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource;
|
||||||
@@ -167,15 +166,13 @@ class VacationRequestController extends Controller
|
|||||||
return $pdf->stream();
|
return $pdf->stream();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(CreateVacationRequestRequest $request): Response
|
public function create(Request $request): Response
|
||||||
{
|
{
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->orderByProfileField("last_name")
|
->orderByProfileField("last_name")
|
||||||
->orderByProfileField("first_name")
|
->orderByProfileField("first_name")
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$requestData = $request->data();
|
|
||||||
|
|
||||||
return inertia("VacationRequest/Create", [
|
return inertia("VacationRequest/Create", [
|
||||||
"vacationTypes" => VacationType::casesToSelect(),
|
"vacationTypes" => VacationType::casesToSelect(),
|
||||||
"users" => SimpleUserResource::collection($users),
|
"users" => SimpleUserResource::collection($users),
|
||||||
@@ -183,8 +180,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" => (int)$request->get("user"),
|
||||||
"vacationFromDate" => $requestData["from_date"],
|
"vacationFromDate" => $request->get("from_date"),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
|
|||||||
<?php
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
declare(strict_types=1);
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
namespace Toby\Infrastructure\Http\Requests;
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
use Illuminate\Foundation\Http\FormRequest;
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
use Toby\Eloquent\Models\VacationRequest;
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
class CreateVacationRequestRequest extends FormRequest
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
{
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
protected $redirectRoute = "vacation.requests.create";
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
public function authorize(): bool
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
{
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
return ($this->get("user") === null) ||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
((int)$this->get("user") === $this->user()->id) ||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
}
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
public function rules(): array
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
{
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
return [
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
"user" => ["nullable", "exists:users,id"],
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
"from_date" => ["nullable", "date_format:Y-m-d"],
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
];
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
}
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
public function data(): array
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
{
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
return [
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
"user" => (int)$this->get("user"),
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
"from_date" => $this->get("from_date"),
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
];
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
}
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
|||||||
}
|
|
||||||
![]()
```suggestion
return ($this->get("user") === null) ||
((int)$this->get("user") === $this->user()->id) ||
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```
![]() Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods. Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
![]() Restore this version?
Restore this version?
https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
![]() Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date. Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
|
Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
Restore this version?
5f02e23f51 (diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d)
Restore this version?
5f02e23f51 (diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d)
Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.