user11001/eloquent-model-generator
Eloquent Model Generator
63,819
92
| Install | |
|---|---|
composer require user11001/eloquent-model-generator |
|
| Latest Version: | v3.1.0 |
| PHP: | ^8.4 |
| License: | MIT |
| Last Updated: | May 2, 2026 |
| Links: | GitHub · Packagist |
Maintainer: pepijnolivier
Eloquent Model Generator
This Laravel package will generate models with their appropriate Eloquent relations based on an existing database schema.
For automatically generating database migrations for your schema, see kitloong/laravel-migrations-generator
Requirements
- PHP 8.4+
- Laravel 12+
Installation
You can install the package via composer:
composer require --dev pepijnolivier/eloquent-model-generator
You can publish the config file with:
php artisan vendor:publish --tag="eloquent-model-generator-config"
This is the contents of the published config file:
<?php
use Illuminate\Database\Eloquent\Model;
return [
/*
|--------------------------------------------------------------------------
| Namespace
|--------------------------------------------------------------------------
|
| The default namespace for generated models.
|
*/
'model_namespace' => 'App\Models\Generated',
'trait_namespace' => 'App\Models\Generated\Relations',
/*
|--------------------------------------------------------------------------
| Output Path
|--------------------------------------------------------------------------
|
| Path where the models will be created.
|
*/
'model_path' => 'app/Models/Generated',
'trait_path' => 'app/Models/Generated/Relations',
/*
|--------------------------------------------------------------------------
| Extend Model
|--------------------------------------------------------------------------
|
| Extend the base model.
|
*/
'extend' => Model::class,
];
Usage
php artisan generate:models
Testing
composer test
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please see SECURITY for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
631,580,251
9,707
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
404,034,618
608
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
384,821,166
4,658