'Redirect to /create button link

I want to create a button in list view that if the user click, it is redirected to the create form with the data completed with the attributes of the clicked entity.

Screenshot 1:

Button in list view

And it is redirected to te /create form with the data completed in the fields

Screenshot 2:

Redirected to /create with attributes completed

Then the user can modify the data and save it.

Ive tried put /create?default=123 CRUD::field('estado')->type('text')->default(request('default') ?? null);

And it works. But what about select2_from_ajax_field?? It seems that the default value is not working.

There is a way to acheve this?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source