Hello! Good morning, I would like to know how to disable action buttons with php when passing the year we are in, for example: if we are in 2022 and we reach 2023, I want the 2022 buttons to be blocked and that this be global, for example:
if(date("YEAR") > $añoPasado){ //sentencia que bloquee botones de los años anteriores al actual}
What is shown is just an example of the idea, they would help me a lot! ,If more details are needed I am happy to reply and edit!!
For the management of dates and their calculations, it is recommended to use Carbon since it has predefined functions to do everything you like with dates. I leave you an example of what you could do to solve your order.
As you can see, most of these functions return boolean values to implement your conditions, I leave you the documentation .