[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
BACKUP C 19-12
/
XAMPP74
/
htdocs
/
surat
/
app
/
Http
/
Requests
/
[
Home
]
File: StoreUserRequest.php
<?php namespace App\Http\Requests; use App\Enums\Role; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class StoreUserRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize(): bool { return auth()->user()->role == Role::ADMIN->status(); } /** * @return array */ public function attributes(): array { return [ 'name' => __('model.user.name'), 'email' => __('model.user.email'), 'phone' => __('model.user.phone'), ]; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules(): array { return [ 'name' => ['required'], 'email' => ['required', Rule::unique('users')], 'phone' => ['nullable'], ]; } }