Is there some way to generate models from database in Laravel 5?
The generators package only create an empty model.
If you are using MySQL and Laravel 5.1 or above you can use php artisan code:models
from this package: reliese/laravel. All you need to do is:
composer require reliese/laravel
config/app.php
file Reliese\Coders\CodersServiceProvider::class
php artisan vendor:publish --tag=reliese-models
config/database.php
and .env
files.php artisan code:models
This package will scan your database and create all models for you. If you need something more specific, you can customize its config file.
Hope this helps :)