laravel-crud-generator icon indicating copy to clipboard operation
laravel-crud-generator copied to clipboard

Published stubs does not get used

Open rabol opened this issue 5 months ago • 1 comments

I published the stubs like this:

php artisan vendor:publish --tag=stubs-crud

the I modified the resources/stubs/crud/views/livewire/index.stub like this:

(dark mode support)

<section class="w-full">
    <div class="relative mb-6 w-full">
        <flux:heading size="xl" level="1">{{ __('{{modelTitlePlural}}') }}</flux:heading>
        <flux:subheading size="lg" class="mb-6">
            A list of all the {{ __('{{modelTitlePlural}}') }}
        </flux:subheading>
        <flux:separator variant="subtle" />
    </div>

    <div class="py-12">
        <div class="max-w-full mx-auto sm:px-6 lg:px-8 space-y-6">
            <div class="p-4 sm:p-8 bg-white dark:bg-gray-900 shadow sm:rounded-lg">
                <div class="w-full">
                    <div class="sm:flex sm:items-center">
                        <div class="sm:flex-auto"></div>
                        <div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
                            <flux:button variant="primary" :href="route('{{modelRoute}}.create')">
                                {{ __('Add New') }}
                            </flux:button>
                        </div>
                    </div>

                    <div class="flow-root">
                        <div class="mt-8 overflow-x-auto">
                            <div class="inline-block min-w-full py-2 align-middle">
                                <table class="w-full divide-y divide-gray-300 dark:divide-gray-700">
                                    <thead class="bg-gray-50 dark:bg-gray-800">
                                    <tr>
                                        <th scope="col" class="py-3 pl-4 pr-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">
                                            No
                                        </th>
                                        {{tableHeader}}
                                        <th scope="col" class="px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400"></th>
                                    </tr>
                                    </thead>
                                    <tbody class="divide-y divide-gray-200 dark:divide-gray-800 bg-white dark:bg-gray-900">
                                    @foreach (${{modelNamePluralLowerCase}} as ${{modelNameLowerCase}})
                                        <tr class="even:bg-gray-50 dark:even:bg-gray-800" wire:key="{{ ${{modelNameLowerCase}}->id }}">
                                            <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-semibold text-gray-900 dark:text-gray-100">
                                                {{ ++$i }}
                                            </td>
                                            {{tableBody}}
                                            <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 dark:text-gray-100">
                                                <a wire:navigate href="{{ route('{{modelRoute}}.show', ${{modelNameLowerCase}}->id) }}"
                                                   class="text-gray-600 dark:text-gray-300 font-bold hover:text-gray-900 dark:hover:text-white mr-2">
                                                    {{ __('Show') }}
                                                </a>
                                                <a wire:navigate href="{{ route('{{modelRoute}}.edit', ${{modelNameLowerCase}}->id) }}"
                                                   class="text-indigo-600 dark:text-indigo-400 font-bold hover:text-indigo-900 dark:hover:text-indigo-200 mr-2">
                                                    {{ __('Edit') }}
                                                </a>
                                                <button
                                                    class="text-red-600 dark:text-red-400 font-bold hover:text-red-900 dark:hover:text-red-200"
                                                    type="button"
                                                    wire:click="delete({{ ${{modelNameLowerCase}}->id }})"
                                                    wire:confirm="Are you sure you want to delete?"
                                                >
                                                    {{ __('Delete') }}
                                                </button>
                                            </td>
                                        </tr>
                                    @endforeach
                                    </tbody>
                                </table>

                                <div class="mt-4 px-4">
                                    {!! ${{modelNamePluralLowerCase}}->withQueryString()->links() !!}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

i then deleted the old 'Flights' files and did this:

php artisan make:crud flights livewire

but i got the files from the /vendor/ folder, not the stubs that I had published

Did I miss something ?

rabol avatar May 11 '25 17:05 rabol