51 lines
2.3 KiB
PHP
51 lines
2.3 KiB
PHP
<x-app-layout>
|
|
<div class="max-w-2xl mx-auto p-4 sm:p-6 lg:p-8">
|
|
<form method="POST" action="{{ route('tests.store') }}">
|
|
@csrf
|
|
<div class="flex flex-col gap-1">
|
|
<x-input-label>{{ __("Name") }}</x-input-label>
|
|
<x-text-input name="name" placeholder="{{ __('Name') }}" value="{{ old('name') }}" />
|
|
<x-input-error :messages="$errors->get('name')" class="mt-2" />
|
|
</div>
|
|
|
|
<x-primary-button class="mt-4">{{ __('Create test') }}</x-primary-button>
|
|
</form>
|
|
|
|
<table class="mt-6 border border-gray-300 w-full text-left">
|
|
<tr>
|
|
<th class="border border-gray-300 p-1">{{ __("Name") }}</th>
|
|
<th class="border border-gray-300 p-1"></th>
|
|
</tr>
|
|
|
|
@foreach ($tests as $test)
|
|
<tr>
|
|
<td class="border border-gray-300 p-1">{{ $test->name }}</td>
|
|
<td class="border border-gray-300 p-1">
|
|
<x-dropdown>
|
|
<x-slot name="trigger">
|
|
<button>
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path d="M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z" />
|
|
</svg>
|
|
</button>
|
|
</x-slot>
|
|
<x-slot name="content">
|
|
<x-dropdown-link :href="route('tests.edit', $test)">
|
|
{{ __("Edit") }}
|
|
</x-dropdown-link>
|
|
<form method="POST" action="{{ route("tests.destroy", $test) }}">
|
|
@csrf
|
|
@method("delete")
|
|
<x-dropdown-link :href="route('tests.destroy', $test)" onclick="event.preventDefault(); this.closest('form').submit();">
|
|
{{ __("Delete") }}
|
|
</x-dropdown-link>
|
|
</form>
|
|
</x-slot>
|
|
</x-dropdown>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</table>
|
|
</div>
|
|
</x-app-layout>
|