netdjw
netdjw

Reputation: 6007

How to create Laravel model from migration?

I found many results how to create migration from a model, but is there any way to create a model from migrations?

Basically I want to give a table name, and if there is multiple migration files (one to create and others to update the previous states) the model could be updated.

Is there any solution for this?

Upvotes: 4

Views: 5249

Answers (1)

atymic
atymic

Reputation: 3128

I'm not sure that there's a good way to create a model directly from migrations, as it depends on what database you use as to the exact structure of your tables.

There seems to be a package which support generating the models from your database, however: https://github.com/laracademy/generators

Upvotes: 4

Related Questions