first&last

This commit is contained in:
sbb45
2026-03-20 15:47:17 +05:00
commit d6441abdd2
230 changed files with 20367 additions and 0 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreUserRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', 'unique:users,email'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
'role' => ['required', Rule::in(['admin', 'manager', 'technician', 'client'])],
'department_id' => ['nullable', 'exists:departments,id'],
'phone' => ['nullable', 'string', 'max:32'],
'is_active' => ['nullable', 'boolean'],
];
}
}
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateUserRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$user = $this->route('user');
return [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', Rule::unique('users', 'email')->ignore($user)],
'password' => ['nullable', 'string', 'min:8', 'confirmed'],
'role' => ['required', Rule::in(['admin', 'manager', 'technician', 'client'])],
'department_id' => ['nullable', 'exists:departments,id'],
'phone' => ['nullable', 'string', 'max:32'],
'is_active' => ['nullable', 'boolean'],
];
}
}