view src/Generator/View/stubs/create_edit.stub @ 40:2cf26b593f4a ls_dev_2025_09 tip

better support for different column types
author Luka Sitas <sitas.luka.97@gmail.com>
date Thu, 16 Oct 2025 10:54:04 -0400
parents 8dd668020310
children
line wrap: on
line source

<x-app-layout>
    <x-slot name="header">
        <h2 class="fw-semibold fs-4 text-dark">
            {{ isset($item) ? 'Edit' : 'Create' }} {{ ucfirst('{{ modelVariable }}') }}
        </h2>
    </x-slot>

    <div class="py-5">
        <div class="container">
            <div class="bg-white shadow-sm rounded p-4">
                    <form method="POST" action="{{ isset($item) ? route('{{ tableName }}.update', $item) : route('{{ tableName }}.store') }}">
										@csrf
                    @if (isset($item))
                        @method('PUT')
                    @endif

										{{ fieldsInsertPoint }}

                    <div class="d-flex justify-content-end">
                        <a href="{{ route('{{ tableName }}.index') }}"
                            class="btn btn-secondary me-2">Back</a>
                        <button type="submit" class="btn btn-primary">
                            {{ isset($item) ? 'Update' : 'Create' }}
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</x-app-layout>