user897237
user897237

Reputation: 623

Generating models from existing database at once

I'm trying to generate models from an existing database at once without having to do it separately for all tables. I have tried to do this with reliese/laravel. I have executed:

php artisan -v code:models

However, I'm getting the following error.

ErrorException : mkdir(): Invalid path at C:\xampp\htdocs\schaden\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:466 462| if ($force) { 463| return @mkdir($path, $mode, $recursive); 464| } 465|

466| return mkdir($path, $mode, $recursive); 467| } 468| 469| /** 470| * Move a directory.

Exception trace: 1 mkdir("") C:\xampp\htdocs\schaden\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:466

I'm not posting the full error stack here. Can anyone help?

Upvotes: 0

Views: 4159

Answers (1)

McRui
McRui

Reputation: 1931

Probably the best solution is using the package Eloquent Model Generator that you can find on github at https://github.com/krlove/eloquent-model-generator.

Then you can easily use, for example, php artisan krlove:generate:model User --table-name=users or php artisan krlove:generate:model MyModel --table-name=my_models and use some of the package options.

Upvotes: 1

Related Questions