maDE
1 week ago
100
3
Laravel

LV8 jetstream /register: set default value from get-parameter

Posted 1 week ago by maDE

Hi,

i added a new field to the register form:

            <div class="mt-4">
                <x-jet-label for="code" value="{{ __('Invite Code') }}" />
                <x-jet-input id="code" class="block mt-1 w-full" type="text" name="code" :value="old('code')" required />
            </div>

Now i need an easy solution for set the deafult value from a get parameter: https://domain.tld/register?code=1234

I tried this without success:

 :value="old('code', '{{ app(\'request\')->input(\'code\') }}')"

What is the perfect way here?

best regards, daniel.

Please sign in or create an account to participate in this conversation.