Greetings, I just began to study Laravel, when a reasonable question arose on the assumption that it is extremely undesirable to keep business logic in controllers.
A simple script:
a person enters a domain in the form, if the regex data matched (I have the pattern) (I think regex should be checked in the controller), if the domain does not exist (this check must be done not in the controller as far as I understand it?) then
- create a record in the database
- redirect the user to the created domain ID
otherwise
- redirect the user to the domain ID
How to organize it in a controller and why it should be implemented. I really hope for a detailed answer, thanks.