rawilk / laravel-form-components

Form components built for Tailwind & Livewire.
https://randallwilk.dev/docs/laravel-form-components
MIT License
386 stars 42 forks source link

[Feature Request]: Kitchen sink example full form #54

Closed howdu closed 1 year ago

howdu commented 2 years ago

Feature Description

Loving this package thank you :) Just thinking it would be great to see what's possible with this package by default at a glance. E.g such as the grid to stack form groups? Submit button

<form action="{{ route('customer.profile.update') }}" enctype="multipart/form-data" method="post">
    @csrf
    <x-form-group label="Name" name="name">
        <x-input name="name" :value="old('name', $user->name)" required />
    </x-form-group>

    <x-form-group label="Email" name='email'>
        <x-input name="email" type="email" :value="old('email', $user->email)" required />
    </x-form-group>

    <x-form-group label="Phone" name='phone'>
        <x-input name="phone" type="tel" :value="old('phone', $user->phone)" required />
    </x-form-group>

    <div class='lg:grid lg:grid-cols-2 lg:space-x-8'>
        <x-form-group label="Billing Address" name="billing_address_id">
            <x-select name="billing_address_id"
                :value="old('billing_address_id', $user->billing_address_id)" :options="$addresses"
                required>
                <option value=''>Select Address</option>
            </x-select>
        </x-form-group>

        <x-form-group label="Delivery Address" name="delivery_address_id">
            <x-select name="delivery_address_id"
                :value="old('delivery_address_id', $user->delivery_address_id)"
                :options="$addresses" required>
            </x-select>
        </x-form-group>
    </div>

    <x-form-group>
        <x-form.button>Save Details</x-form.button>
    </x-form-group>
</form>

Is this feature valuable for other users as well and why?

No response

rawilk commented 1 year ago

I could certainly modify the docs to show more advanced examples. I'm not sure when I'd have a chance to do that though, but a PR updating the docs could possibly be merged.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.