comparison src/Generator/View/stubs/index.stub @ 31:8dd668020310 codex

started converting too bootstrap, also better support for casts
author Luka Sitas <sitas.luka.97@gmail.com>
date Tue, 19 Aug 2025 20:34:53 -0400
parents 555bfaa500ac
children 45f384a24553
comparison
equal deleted inserted replaced
30:21439512ba69 31:8dd668020310
1 <x-app-layout> 1 <x-app-layout>
2 <x-slot name="header"> 2 <x-slot name="header">
3 <h2 class="font-semibold text-xl text-gray-800 leading-tight"> 3 <h2 class="fw-semibold fs-4 text-dark">
4 All {{ Str::plural(ucfirst('{{ modelVariable }}')) }} 4 All {{ Str::plural(ucfirst('{{ modelVariable }}')) }}
5 </h2> 5 </h2>
6 </x-slot> 6 </x-slot>
7 7
8 <div class="py-12"> 8 <div class="py-5">
9 <div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> 9 <div class="container">
10 <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6"> 10 <div class="bg-white shadow-sm rounded p-4">
11 <div class="flex items-center justify-between mb-4"> 11 <div class="d-flex align-items-center justify-content-between mb-3">
12 <span></span> 12 <span></span>
13 <a href="{{ route('{{ tableName }}.create') }}" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"> 13 <a href="{{ route('{{ tableName }}.create') }}" class="btn btn-primary">
14 + New {{ ucfirst('{{ modelVariable }}') }} 14 + New {{ ucfirst('{{ modelVariable }}') }}
15 </a> 15 </a>
16 </div> 16 </div>
17 <table class="w-full text-left border-collapse table-auto"> 17 <table class="table table-hover">
18 <thead> 18 <thead>
19 <tr class="border-b"> 19 <tr>
20 {{ headerInsertPoint }} 20 {{ headerInsertPoint }}
21 <th class=" p-2">Actions</th> 21 <th scope="col">Actions</th>
22 </tr> 22 </tr>
23 </thead> 23 </thead>
24 <tbody> 24 <tbody>
25 @forelse ($items as $item) 25 @forelse ($items as $item)
26 <tr class="border-b"> 26 <tr>
27 {{ valueInsertPoint }} 27 {{ valueInsertPoint }}
28 <td class="p-2"> 28 <td>
29 <div class="flex space-x-2"> 29 <div class="d-flex gap-2">
30 <a href="{{ route('{{ tableName }}.show', $item) }}" class="text-blue-600 hover:underline">View</a> 30 <a href="{{ route('{{ tableName }}.show', $item) }}" class="text-primary">View</a>
31 <a href="{{ route('{{ tableName }}.edit', $item) }}" class="text-yellow-600 hover:underline">Edit</a> 31 <a href="{{ route('{{ tableName }}.edit', $item) }}" class="text-warning">Edit</a>
32 <form action="{{ route('{{ tableName }}.destroy', $item) }}" method="POST" class="inline"> 32 <form action="{{ route('{{ tableName }}.destroy', $item) }}" method="POST" class="d-inline">
33 @csrf 33 @csrf
34 @method('DELETE') 34 @method('DELETE')
35 <button type="submit" class="text-red-600 hover:underline" onclick="return confirm('Delete?')">Delete</button> 35 <button type="submit" class="btn btn-link text-danger p-0" onclick="return confirm('Delete?')">Delete</button>
36 </form> 36 </form>
37 </div> 37 </div>
38 </td> 38 </td>
39 </tr> 39 </tr>
40 @empty 40 @empty
41 <tr> 41 <tr>
42 <td class="p-2" colspan="{{ colCount }}">No {{ tableName }} found.</td> 42 <td colspan="{{ colCount }}">No {{ tableName }} found.</td>
43 </tr> 43 </tr>
44 @endforelse 44 @endforelse
45 </tbody> 45 </tbody>
46 </table> 46 </table>
47 </div> 47 </div>
48 </div> 48 </div>
49 </div> 49 </div>
50 </x-app-layout> 50 </x-app-layout>