Enforce PHP and Blade formatting
All checks were successful
Tests / Laravel tests (pull_request) Successful in 12m39s

This commit is contained in:
2026-06-03 22:22:39 +02:00
parent aab8d33b8d
commit 886e3993fc
47 changed files with 946 additions and 283 deletions

View File

@@ -1,57 +1,62 @@
<div class="space-y-6">
<div>
<label for="type" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Type</label>
<select id="type" name="type" class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
<option value="rating" @selected(old('type', $skill->type ?? 'rating') === 'rating')>Rating</option>
<option value="tag" @selected(old('type', $skill->type ?? '') === 'tag')>Tag</option>
<option value="other" @selected(old('type', $skill->type ?? '') === 'other')>Overig</option>
</select>
</div>
<div>
<label for="type" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Type</label>
<select id="type" name="type"
class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
<option value="rating" @selected(old('type', $skill->type ?? 'rating') === 'rating')>Rating</option>
<option value="tag" @selected(old('type', $skill->type ?? '') === 'tag')>Tag</option>
<option value="other" @selected(old('type', $skill->type ?? '') === 'other')>Overig</option>
</select>
</div>
<div>
<label for="title" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Titel</label>
<input type="text" id="title" name="title" value="{{ old('title', $skill->title ?? '') }}" class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
<input type="text" id="title" name="title" value="{{ old('title', $skill->title ?? '') }}"
class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
</div>
<div id="description-field">
<label for="description" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Beschrijving</label>
<textarea id="description" name="description" rows="4" class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">{{ old('description', $skill->description ?? '') }}</textarea>
<textarea id="description" name="description" rows="4"
class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">{{ old('description', $skill->description ?? '') }}</textarea>
</div>
<div id="rating-field">
<label for="rating" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Beoordeling (110)</label>
<input type="number" id="rating" name="rating" min="1" max="10" value="{{ old('rating', $skill->rating ?? 5) }}" class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
</div>
<label for="rating" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Beoordeling
(110)</label>
<input type="number" id="rating" name="rating" min="1" max="10"
value="{{ old('rating', $skill->rating ?? 5) }}"
class="mt-1 w-full px-3 py-2 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded">
</div>
<div id="image-field">
<label for="image" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Afbeelding</label>
<input type="file" id="image" name="image" class="mt-1 text-gray-800 dark:text-gray-100">
@if (!empty($skill) && $skill->getFirstMediaUrl('image'))
<img src="{{ $skill->getFirstMediaUrl('image') }}" class="mt-2 max-w-xs rounded">
@endif
</div>
<div id="image-field">
<label for="image" class="block text-sm font-medium text-gray-700 dark:text-gray-200">Afbeelding</label>
<input type="file" id="image" name="image" class="mt-1 text-gray-800 dark:text-gray-100">
@if (!empty($skill) && $skill->getFirstMediaUrl('image'))
<img src="{{ $skill->getFirstMediaUrl('image') }}" class="mt-2 max-w-xs rounded">
@endif
</div>
</div>
@push('scripts')
<script>
function toggleFields() {
const type = document.getElementById('type').value;
<script>
function toggleFields() {
const type = document.getElementById('type').value;
// Rating alleen tonen bij type = rating
document.getElementById('rating-field').style.display = (type === 'rating') ? 'block' : 'none';
// Rating alleen tonen bij type = rating
document.getElementById('rating-field').style.display = (type === 'rating') ? 'block' : 'none';
// Image tonen bij rating en other
document.getElementById('image-field').style.display = (type === 'rating' || type === 'other') ? 'block' :
'none';
// Image tonen bij rating en other
document.getElementById('image-field').style.display = (type === 'rating' || type === 'other') ? 'block' : 'none';
// Beschrijving alleen tonen bij rating
document.getElementById('description-field').style.display = (type === 'rating') ? 'block' : 'none';
}
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('type').addEventListener('change', toggleFields);
toggleFields(); // initial
});
</script>
// Beschrijving alleen tonen bij rating
document.getElementById('description-field').style.display = (type === 'rating') ? 'block' : 'none';
}
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('type').addEventListener('change', toggleFields);
toggleFields(); // initial
});
</script>
@endpush

View File

@@ -4,7 +4,8 @@
<form method="POST" action="{{ route('skills.store') }}" enctype="multipart/form-data">
@csrf
@include('skills._form')
<button type="submit" class="mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700">Opslaan</button>
<button type="submit"
class="mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700">Opslaan</button>
</form>
</div>
</x-app-layout>

View File

@@ -5,7 +5,8 @@
@csrf
@method('PUT')
@include('skills._form')
<button type="submit" class="mt-4 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Bijwerken</button>
<button type="submit"
class="mt-4 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">Bijwerken</button>
</form>
</div>
</x-app-layout>

View File

@@ -2,7 +2,8 @@
<div class="p-6 space-y-10">
<h2 class="text-2xl font-semibold text-gray-800 dark:text-white">Vaardigheden</h2>
<a href="{{ route('skills.create') }}" class="inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
<a href="{{ route('skills.create') }}"
class="inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
Nieuwe vaardigheid
</a>
@@ -11,7 +12,7 @@
@endphp
{{-- Rating --}}
@if($groupedSkills->has('rating'))
@if ($groupedSkills->has('rating'))
<div>
<h3 class="text-xl font-bold text-gray-700 dark:text-gray-200 mb-4">Ratings</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
@@ -23,12 +24,13 @@
@endif
{{-- Tags --}}
@if($groupedSkills->has('tag'))
@if ($groupedSkills->has('tag'))
<div>
<h3 class="text-xl font-bold text-gray-700 dark:text-gray-200 mb-4">Tags</h3>
<div class="flex flex-wrap gap-2">
@foreach ($groupedSkills['tag'] as $skill)
<span class="inline-block bg-blue-100 dark:bg-blue-800 text-blue-800 dark:text-blue-100 text-sm px-3 py-1 rounded">
<span
class="inline-block bg-blue-100 dark:bg-blue-800 text-blue-800 dark:text-blue-100 text-sm px-3 py-1 rounded">
{{ $skill->title }}
</span>
@endforeach
@@ -37,7 +39,7 @@
@endif
{{-- Overig --}}
@if($groupedSkills->has('other'))
@if ($groupedSkills->has('other'))
<div>
<h3 class="text-xl font-bold text-gray-700 dark:text-gray-200 mb-4">Overige vaardigheden</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">