DEV.co
Open-Source Databases · reliese

laravel

Reliese Laravel Model Generator is a PHP code-generation tool that inspects your database schema and automatically generates Laravel Eloquent models with typed properties and relationships. It integrates into your Laravel development workflow via Artisan commands and supports MySQL, PostgreSQL, and SQLite.

Source: GitHub — github.com/reliese/laravel
1.7k
GitHub stars
322
Forks
PHP
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryreliese/laravel
Ownerreliese
Primary languagePHP
LicenseMIT — OSI-approved
Stars1.7k
Forks322
Open issues93
Latest releasev1.4.0 (2025-03-20)
Last updated2025-03-20
Sourcehttps://github.com/reliese/laravel

What laravel is

A Composer package that parses database metadata (columns, foreign keys, schemas) and generates Laravel 5.1+ Eloquent models with property type hints and relationship definitions. It offers configuration-driven scaffolding with options to preserve custom model code via a base-model inheritance pattern.

Quickstart

Get the laravel source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/reliese/laravel.gitcd laravel# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Rapid Laravel prototype and early-stage development

Generate initial model scaffolding from existing database schemas to accelerate project setup and reduce manual boilerplate, especially useful in greenfield Laravel projects with well-defined schemas.

Keeping models synchronized with schema changes

Iterate database design during development and regenerate models via `php artisan code:models` without manually updating properties and relationships each time, particularly when enabling base-model mode.

Multi-database Laravel applications

Generate models for specific connections and schemas (e.g., `--connection=mysql --schema=shop`), making it practical for applications spanning multiple data sources.

Implementation considerations

  • Install via Composer with `--dev` flag to restrict to development environments; do not deploy to production.
  • Publish configuration with `php artisan vendor:publish --tag=reliese-models` and customize `config/models.php` before first use to match naming conventions and namespace structure.
  • Enable `base_files: true` in config if you plan custom model additions; this creates base model classes you regenerate and user models that inherit from them, preventing code loss on re-scaffolding.
  • Run `php artisan config:clear` after publishing config to ensure Laravel cache does not serve stale settings.
  • Test generated models against your actual database connection and verify foreign key detection and relationship generation before committing to version control.

When to avoid it — and what to weigh

  • Models require complex business logic or custom relationship logic beyond standard ORM patterns — The tool generates basic CRUD scaffolding; hand-crafted domain models with custom getters, mutators, scopes, or specialized query builders will be lost or overwritten on regeneration unless carefully managed.
  • Your workflow demands tight version control of model definitions without regeneration cycles — Regenerating models can create merge conflicts and schema-drift issues in teams; projects using declarative migrations + explicit model maintenance may prefer hand-written models.
  • Security-sensitive operations require audit trails or strict model provenance — Auto-generated code may obscure intent and complicate compliance audits; highly regulated systems should consider explicit, versioned model definitions.
  • You are using it in production without a development-only constraint — README explicitly recommends dev-only installation (`--dev` flag); production exposure of code generation tooling increases attack surface unnecessarily.

License & commercial use

Licensed under MIT (MIT License), a permissive OSI-approved license permitting commercial use, modification, and redistribution with no warranty.

MIT license permits commercial use of the generated code and the tool itself without restrictions. However, as a development dependency, review your deployment model to ensure the package is not exposed in production environments. Internal use for model scaffolding in commercial Laravel applications is unrestricted.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Install only as `--dev` dependency to prevent production exposure of code generation logic. Generated models inherit Laravel's ORM security properties (parameter binding, validation framework integration) but are not inherently more or less secure than hand-written models. Auto-generated relationship bindings should be reviewed to ensure they match business logic intent. No security audit or CVE history provided; assume standard OSS review practices.

Alternatives to consider

Laravel IDE Helper (barryvdh/laravel-ide-helper)

Generates IDE helper files and property hints from existing models instead of generating models themselves; better for teams with hand-written model preference who need autocomplete.

Artisan make:model with --migration

Native Laravel scaffolding; simpler for small projects and gives full control, but requires manual property/relationship definitions and offers no schema introspection.

Doctrine ORM or Propel ORM

Full ORM alternatives with their own code generation; heavier weight but more feature-rich for complex domain models; consider if you need non-Eloquent persistence strategies.

Software development agency

Build on laravel with DEV.co software developers

Use Reliese to inspect your database schema and generate fully-typed Eloquent models in seconds. Perfect for rapid prototyping and keeping models synchronized with schema changes.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

laravel FAQ

Can I keep my custom model code after regeneration?
Yes, enable `base_files: true` in `config/models.php`. This generates immutable base models that your custom models inherit from, allowing regeneration without overwriting your additions.
Is this safe to use in production?
No. The README explicitly recommends dev-only installation via `composer require --dev`. Use it locally or in CI pipelines to generate models, then commit the result; do not deploy the package itself.
What databases are supported?
MySQL, PostgreSQL, and SQLite are officially supported. Other database types can be added via pull requests. Specify connection and schema via Artisan options.
How do I regenerate models after schema changes?
Run `php artisan code:models` (all tables from default connection) or target specific tables/connections with `--table=name` or `--connection=name`. If base_files mode is on, only base classes regenerate; your custom models remain untouched.

Software developers & web developers for hire

Adopting laravel is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.

Accelerate your Laravel development with automated model generation.

Use Reliese to inspect your database schema and generate fully-typed Eloquent models in seconds. Perfect for rapid prototyping and keeping models synchronized with schema changes.