Say we have other parts of the application using this command to follow users.
For example we could read a csv file to create this relationships and call the same command.
My question is where we should define the rule to not allow one user to follow another user more than once? I know we can define a unique key on the database. But where, in the application level?
Should it be defined/called from the handle method? Would it be something like "beforeHandle"
I know it's quite open and application dependent, but I would like to have a general idea.
Another question is where to define a db transaction? Controller? meta command?
https://github.com/laracasts/larabook/blob/master/app/Larabook/Users/FollowUserCommandHandler.php
Say we have other parts of the application using this command to follow users. For example we could read a csv file to create this relationships and call the same command.
My question is where we should define the rule to not allow one user to follow another user more than once? I know we can define a unique key on the database. But where, in the application level?
Should it be defined/called from the handle method? Would it be something like "beforeHandle"
I know it's quite open and application dependent, but I would like to have a general idea. Another question is where to define a db transaction? Controller? meta command?
Thanks