{"repo":"giacomomasseron/laravel-models-generator","free":true,"listed":false,"github":"https://github.com/giacomomasseron/laravel-models-generator","clone":"git clone https://github.com/giacomomasseron/laravel-models-generator.git","description":"Generate Laravel models from existing database","language":"PHP","stars":56,"topics":["database","eloquent","eloquent-models","laravel","scaffold","php","laravel-components","mysql-database"],"license":"MIT","category":"databases-storage","readme_excerpt":"Generate Laravel models from an existing database Compatible with Laravel 9/10/11/12/13. Major features: - PHPStan level 9/10 compliant - Laravel 11/12/13 style (using new models attributes) - Polymorphic relationships - Uuids / Ulids columns - Enums casting - URI casting - JSON casting Drivers supported - MariaDB - MySQL - SQLite - PostgreSQL - SQLServer Coming soon ... all drivers supported by doctrine/dbal. Installation You can install the package via composer: Usage / Generate models For basic usage, you can generate models with the command: Factories The package can generate factories for your models. The factories will be created in database/factories directory, and they use standard Laravel fake functions to fill fields. You can generate model factories with the command: or Other usages To generate models from a specific connection: To generate models from a specific schema: To generate a single table: Config You can publish the config file with: This is the contents of the published config file: Polymorphic relationships To add polymorphic relationships to your models, you can use morphs array in the config file. If you have tables like this: And config file like this: This relationship will be created in the Image model: This relationship will be created in the Post model: Interfaces If you want your models implement interface(s), use interfaces value in config: Traits If you want your models use trait(s), use traits value in config: Testing Changelog Please see CHAN","default_branch":null,"files":null,"tree":[],"storefront":"/r/giacomomasseron","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/giacomomasseron/laravel-models-generator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}