Warning, you may end up overwriting your JetStream or any other scaffolding models. take backup of them before overwriting them.
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
- Add the service provider to your
config/app.php
file RelieseCodersCodersServiceProvider::class
- Publish the config file with
php artisan vendor:publish --tag=reliese-models
- Make sure your database is correctly configured in
config/database.php
and .env
files.
- And finally issue the command:
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 :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…