If it is a dummy data, you may be think of Factory.
Ref: https://laravel.com/docs/5.5/database-testing#introduction
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
In production, I don't know how this can be done. I work in a company and thing change a lot and it's quick. I want to make it all static first but the boss want data. What can I do?
Hmmm, rolling back and reset is definitely not the way to go!
I think I know what you're talking about - you're worried that if a new feature doesn't work, you might have new records added, but of course you can't rollback, as that might delete tables that were added when the feature was introduced.
Some tips:
There's an argument to say you should never have a migrate down option. Once a table or structure is changed, your application will change the underlying data in the database. At that point you any reverse migration will be from a different state. e.g. You create a table (but it's incorrect due to a bug), you want to change it but there's already data in it... the typical reverse of a CREATE TABLE is DROP TABLE, but you'll loose data. Instead you might have to migrate up with an ALTER TABLE, or another CREATE TABLE and copy data from one table to another.
Putting on my software engineering hat... Do you need more time to test changes before rollout? Are you spending too much time on fixing small issues? Does the code quality need to be improved? I get the impression that there's a level of urgency, but at the moment the software development processes are not adequate or the demands are too great?
Please or to participate in this conversation.