1
0
tinklu-it-projektas/resources/views/components/user-fields.blade.php
2023-10-29 17:33:32 +02:00

32 lines
1.6 KiB
PHP

@props([
'default_name' => '',
'default_email' => '',
'default_role' => 'admin',
])
<div class="flex flex-col gap-1">
<x-input-label>{{ __("Name") }}</x-input-label>
<x-text-input name="name" placeholder="{{ __('Name') }}" value="{{ old('name', $default_name) }}" />
<x-input-error :messages="$errors->get('name')" class="mt-2" />
<x-input-label>{{ __("Email") }}</x-input-label>
<x-text-input name="email" type="email" placeholder="{{ __('Email') }}" value="{{ old('email', $default_email) }}" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
<x-input-label>{{ __("Password") }}</x-input-label>
<x-text-input name="password" type="password" placeholder="{{ __('Password') }}" />
<x-input-error :messages="$errors->get('password')" class="mt-2" />
<x-input-label>{{ __("Repeat password") }}</x-input-label>
<x-text-input name="password_confirmation" type="password" placeholder="{{ __('Repeat password') }}" />
<x-input-error :messages="$errors->get('repeat_password')" class="mt-2" />
<x-input-label>{{ __("Role") }}</x-input-label>
<x-select name="role" value="student">
<option value="admin" {{ old("role", $default_role) == "admin" ? "selected" : "" }}>{{ __("Admin") }}</option>
<option value="student" {{ old("role", $default_role) == "student" ? "selected" : "" }}>{{ __("Student") }}</option>
<option value="teacher" {{ old("role", $default_role) == "teacher" ? "selected" : "" }}>{{ __("Teacher") }}</option>
</x-select>
<x-input-error :messages="$errors->get('role')" class="mt-2" />
</div>