* #40 - wip * #40 - generate pdf * #40 - fix * Update resources/js/Pages/VacationRequest/Show.vue Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com> * #40 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
declare(strict_types=1);
 | 
						|
 | 
						|
namespace Toby\Infrastructure\Http\Requests;
 | 
						|
 | 
						|
use Illuminate\Foundation\Http\FormRequest;
 | 
						|
use Illuminate\Validation\Rule;
 | 
						|
use Illuminate\Validation\Rules\Enum;
 | 
						|
use Toby\Domain\Enums\EmploymentForm;
 | 
						|
use Toby\Domain\Enums\Role;
 | 
						|
 | 
						|
class UserRequest extends FormRequest
 | 
						|
{
 | 
						|
    public function rules(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            "firstName" => ["required", "min:3", "max:80"],
 | 
						|
            "lastName" => ["required", "min:3", "max:80"],
 | 
						|
            "email" => ["required", "email", Rule::unique("users", "email")->ignore($this->user)],
 | 
						|
            "role" => ["required", new Enum(Role::class)],
 | 
						|
            "position" => ["required"],
 | 
						|
            "employmentForm" => ["required", new Enum(EmploymentForm::class)],
 | 
						|
            "employmentDate" => ["required", "date_format:Y-m-d"],
 | 
						|
        ];
 | 
						|
    }
 | 
						|
 | 
						|
    public function data(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            "first_name" => $this->get("firstName"),
 | 
						|
            "last_name" => $this->get("lastName"),
 | 
						|
            "email" => $this->get("email"),
 | 
						|
            "position" => $this->get("position"),
 | 
						|
            "role" => $this->get("role"),
 | 
						|
            "employment_form" => $this->get("employmentForm"),
 | 
						|
            "employment_date" => $this->get("employmentDate"),
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |