Skip to content

Comments

Be able to send form with default values#254

Closed
skalero01 wants to merge 2 commits intospatie:mainfrom
weblabormx:main
Closed

Be able to send form with default values#254
skalero01 wants to merge 2 commits intospatie:mainfrom
weblabormx:main

Conversation

@skalero01
Copy link

@skalero01 skalero01 commented Jun 6, 2025

Send an example. On this case i use with request. So if my request has ?status=1 it will prefill automatically

{{ html()->formWithDefaults(request()->all(), 'GET', request()->url())->open() }}
    <div class="mt-2 mb-4 flex gap-6 bg-slate-50 p-4 border border-gray-200 rounded-lg">
        {{ html()->select('status', [1 => 'Draft', 2 => 'Sent']) }}
        <div>
            {{ html()->submit(__('Search'))->class('bg-primary-600 text-white px-4 rounded mt-6 py-2 cursor-pointer') }}
        </div>
    </div>
{{ html()->closeFormWithDefaults() }}

skalero01 added 2 commits June 5, 2025 20:26
to be able to send default values
@freekmurze
Copy link
Member

To keep the package simple, I'm going to pass on this for now.

@freekmurze freekmurze closed this Jun 6, 2025
@skalero01
Copy link
Author

@freekmurze but whats the correct way to pass data to the form? if you dont accept the pr i guess there is a way to do it to work with the request data as an example. If not i dont understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants