Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daubac402/4190e74ce54dcac40a8cf309b831d053 to your computer and use it in GitHub Desktop.
Save daubac402/4190e74ce54dcac40a8cf309b831d053 to your computer and use it in GitHub Desktop.
Laravel - Generate models from the database automatically
1. composer require reliese/laravel
2. Add the service provider to your config/app.php file
Reliese\Coders\CodersServiceProvider::class
3. Publish the config file with
php artisan vendor:publish --tag=reliese-models
4. Make sure your database is correctly configured in config/database.php and .env files.
5. Finally run:
php artisan code:models
=> check the results in /app/Models/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment