I usually stick these kind of things in a migration. I like this approach because it keeps it in version control, should I ever need to review when/what changed, and a migration ensures it runs only once.
How/where do you deploy one-time scripts?
Lately I've had the need to e.g. run an eloquent query, and if certain conditions are met, update all of the rows with a value, or send an email, or do something else. These have ended up being quite complex, so I've been running them first in development to make sure everything works OK.
So then I'm left with a script, which I've been running on production in one of two ways: 1) pasting into tinker, but I'm always a bit wary of this because it often pastes weirdly or runs before I've had a chance to give it the once over. or 2) putting it into a migration, but then it logs it in the migrations table which seems a bit unnecessary or 3) it doesn't seem worth going to the bother of creating a command for it either.
Is there a better way?
Please or to participate in this conversation.