view src/Generator/View/stubs/show.stub @ 25:1a717c7b211f codex

added support for some basic views
author Luka Sitas <sitas.luka.97@gmail.com>
date Sun, 11 May 2025 21:03:51 -0400
parents
children 8dd668020310
line wrap: on
line source

<x-app-layout>
    <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            {{ ucfirst('{{ modelVariable }}') }} Details
        </h2>
    </x-slot>

    <div class="py-12">
        <div class="max-w-2xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
                <div class="space-y-4">
                    @foreach($fields as $field)
                        <div>
                            <span class="font-semibold">{{ ucfirst($field) }}:</span>
                            <span class="ml-2">{{ $item->$field }}</span>
                        </div>
                    @endforeach
                </div>
                <div class="flex justify-end mt-6">
                    <a href="{{ route('{{ tableName }}.edit', $item) }}" class="mr-2 px-4 py-2 bg-yellow-400 text-white rounded hover:bg-yellow-500">Edit</a>
                    <a href="{{ route('{{ tableName }}.index') }}" class="px-4 py-2 bg-gray-200 rounded hover:bg-gray-300">Back</a>
                </div>
            </div>
        </div>
    </div>
</x-app-layout>