pepijnolivier / eloquent-model-generator
Eloquent Model Generator
Installs: 114
Dependents: 0
Suggesters: 0
Security: 0
Stars: 92
Watchers: 8
Forks: 17
Open Issues: 8
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- illuminate/support: ^10.13
- kitloong/laravel-migrations-generator: ^6.10
- nette/php-generator: ^4.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ~7
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-11-06 02:28:31 UTC
README
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.1+
- Laravel 8+
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.