How does Laravel generate a file corresponding to an existing database table? Such as migrate and model files

Source: Internet
Author: User
I just got in touch with Laravel and want to try to use Laravel to reconstruct an old project. Now I have a problem. If I want to develop a team in the future, therefore, it is very convenient to use migrate in the database, but because it is an old project, there are already a large number of data tables. If you manually write migrate... I just got in touch with Laravel and want to try to use Laravel to reconstruct an old project. Now I have a problem. If I want to develop a team in the future, therefore, it is very convenient to use migrate in the database, but because it is an old project, there are already a large number of data tables. It is very difficult to manually write migrate. I don't know if I can automatically generate a migrate file for an existing data table.

In addition, the model file does not know whether it can automatically generate the basic files required by Eloquent ORM in batches based on the database. I just need to modify the files.

Reply content:

I just got in touch with Laravel and want to try to use Laravel to reconstruct an old project. Now I have a problem. If I want to develop a team in the future, therefore, it is very convenient to use migrate in the database, but because it is an old project, there are already a large number of data tables. It is very difficult to manually write migrate. I don't know if I can automatically generate a migrate file for an existing data table.

In addition, the model file does not know whether it can automatically generate the basic files required by Eloquent ORM in batches based on the database. I just need to modify the files.

Google search does not have: Laravel extension recommendation: DbExporter reverse Migration and db: seed

Similar extension packages include:
Https://github.com/Xethron/migrations-generator
Https://github.com/orangehill/iseed

Migrations Generator

Generate Laravel Migrations from an existing database, including
Indexes and foreign keys!

I guess that's what you need, right?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.