How do I submit a form automatically?

I'm implementing a function to bind tenants.

  1. I want to execute the bind function directly when the url contains /bind?code=abc
  2. render a page for the user to enter the code when it doesn't exist.
What should I do?


I tried to do this, but I don't know how the form should be submitted automatically.
TextInput::make('code')
                ->label('Code')
                ->required()
                ->helperText(
                    'Please enter the code provided by your company. If you do not have a code, contact your company administrator.'
                )
                ->default(function (Set $set, Request $request) {
                    if ($request->has('code')) {
                        return $request->get('code');
                    }
                    return null;
                }),
Was this page helpful?