#157 - more interactive calendar #162

Merged
kamilniemczycki merged 20 commits from #157-expansion-calendar into main 2022-06-08 11:02:38 +02:00
2 changed files with 3 additions and 42 deletions
Showing only changes of commit ba1d5bce2a - Show all commits

View File

@@ -28,7 +28,6 @@ use Toby\Domain\VacationTypeConfigRetriever;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\User;
use Toby\Eloquent\Models\VacationRequest;
use Toby\Infrastructure\Http\Requests\CreateVacationRequestRequest;
use Toby\Infrastructure\Http\Requests\VacationRequestRequest;
use Toby\Infrastructure\Http\Resources\SimpleUserResource;
use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource;
@@ -167,15 +166,13 @@ class VacationRequestController extends Controller
return $pdf->stream();
}
public function create(CreateVacationRequestRequest $request): Response
public function create(Request $request): Response
{
$users = User::query()
->orderByProfileField("last_name")
->orderByProfileField("first_name")
->get();
$requestData = $request->data();
return inertia("VacationRequest/Create", [
"vacationTypes" => VacationType::casesToSelect(),
"users" => SimpleUserResource::collection($users),
@@ -183,8 +180,8 @@ class VacationRequestController extends Controller
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class),
"skipFlow" => $request->user()->can("skipFlow", VacationRequest::class),
],
"vacationUserId" => $requestData["user"],
"vacationFromDate" => $requestData["from_date"],
"vacationUserId" => (int)$request->get("user"),
"vacationFromDate" => $request->get("from_date"),
]);
}

View File

@@ -1,36 +0,0 @@
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
<?php
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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);
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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";
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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) ||
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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) ||
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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);
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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 [
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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"],
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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"],
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
];
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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 [
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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"),
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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"),
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
];
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $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); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

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.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

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.