auditionadmin/resources/views/components/auth/form-field.blade.php

22 lines
685 B
PHP

@props([
'name',
'type',
'label' => 'text'
])
@php
$labelClasses = "block text-sm font-medium leading-6 text-gray-900";
$inputClasses = "block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6";
$inputAttributes = [
'id' => $name,
'name' => $name,
'type' => $type,
'class' => $inputClasses
];
@endphp
<div>
<label for="{{ $name }}" class="{{ $labelClasses }}">{{ $label }}</label>
<div class="mt-2">
<input {{$attributes->merge($inputAttributes)}}>
</div>
</div>