How to do backend validation?

I would like to know whats the way to go to do backend validation.

Example: Raffle with 2 Tables Raffle, RaffleTicket:

A PUT with a new Ticket in send to the CMS. How can i check if i have enough tickets in the Raffle-Table before adding the Ticket to the RaffleTicket table?

Do i have to do it in PHP or can i use for example Pyhton or something else?
Or do i use Submission for that and do the PUT on the backend side (in PHP)?

appreciate the help!

1 Like

Da Du einen deutschen Namen hast, finde ich es albern in englisch zu schreiben :smiley: ich hab eh Probleme damit. Aber zum Thema selbst. Ich hab selber backend-validierung umgesetzt. du kannst unter der Klasse modules/Collections/Controller/Admin.php also Admin.php in der Methode save_collection() das Validieren vornehmen.

Für Module ist diese Stelle denkbar schlecht geeignet, aber ich finde auch keine andere Lösung. Evtl. äußert sich nochmal ein Nutzer zum Thema.

Bei der Umsetzung mit PHP wünsche ich Dir sehr viel Glück!

Since you have a German name, I find it silly to write in English :smiley: I have problems with it anyway. But to the topic itself. I have implemented backend-validation myself. you can validate under the class modules/Collections/Controller/Admin.php so Admin.php in the method save_collection().

For modules this place is conceivably badly suitable, but I find also no other solution. Perhaps a user comments again on the topic.

With the implementation with PHP I wish you very good luck!

Translated with www.DeepL.com/Translator (free version)