#157 - more interactive calendar #162
| @@ -183,8 +183,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" => $requestData["user"], | ||||
|             "vacationFromDate" => $requestData["from_date"], | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ class CreateVacationRequestRequest extends FormRequest | ||||
|  | ||||
|  | ||||
|     public function authorize(): bool | ||||
|     { | ||||
|         return is_null($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. | ||||
|         return null === $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. | ||||
|             (int)$this->get("user") === $this->user()->id || | ||||
|             $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); | ||||
|     } | ||||
| @@ -29,8 +29,8 @@ class CreateVacationRequestRequest extends FormRequest | ||||
|   ```suggestion
        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);
```   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.   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   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.   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 | ||||
|     { | ||||
|         return [ | ||||
|             "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. | ||||
|             "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);
```   ```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.   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   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.   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.