Disable button after redirect

1

I have the following situation: A screen (Screen1) where the user chooses the button related to a Set (an entity of my program), it clicks and opens a form of register for that Set.

When you click on register, the form data is saved in the database and the user is redirected to Screen1 again to be able to register the next ones.

Would anyone know how I would be able to generate this Screen1 with the button for the Previously Populated Set deactivated? Thank you very much.

    
asked by anonymous 27.06.2018 / 21:37

1 answer

1

Good afternoon, I believe that in this case, you should store the result of the database operation, something like this:

if($var->save()){
$auxiliar = true;
}

Before sending to the next form, you redirect returning to auxiliary variable, if it is as TRUE, you just need to disable the button with some language (Node, Javascript and etc), checking its status (True or false).

ex:

return redirect()->with($auxiliar);
    
27.06.2018 / 22:42