Reverse engineering or automatic entity generation in Laravel?

I usually work with SF2, and with Doctrine, Entities can be generated automatically, and if you create a scheme in Soft, like MySQL Workbench, you can do Reverse Engineering.

I'm new to Laravel, so is there a way to do these two things? I would use Laravel because I need to make a very small project, but I did not want to write all this code for what we call "Migrations", it seems very boring, no?

So, is there a way to generate this stuff in laravel? Maybe I should use the Laravel Doctrine for this?

+3
source share
3 answers

mysql, Laravel XCMer/larry-four-generator. , .

Larry Four - Laravel 4, . jot DSL genereate . .

-
https://github.com/XCMer/larry-four-generator/tree/master

fork,
https://github.com/XCMer/larry-four-generator/tree/Gadoma-extendedmodels

+9

, , Laravel. :

1) MySQL

mysqldump -u root -p --no-data dbname > schema.sql

2) ,

php artisan migration:make create_schema

3)

class CreateSchema extends Migration {

    public function up()
    {
        $file = file_get_contents(app_path().'/database/data/full_schema.sql', true);

        DB::unprepared($file);
    }

    public function down()
    {
    }

}

4) , - , .

, .

+3

Source: https://habr.com/ru/post/1539547/


All Articles