Download the PHP package zero-to-prod/db-model without Composer

On this page you can find all versions of the php package zero-to-prod/db-model. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db-model

Db Model

Generates PHP artifacts to represent database schemas.

This is useful if you want a single source of truth for your database schema that you can reference in your codebase.

Install the package with db-model:install.

Scaffold PHP representation of your database tables with db-model:generate. Check them with db-model:check.

Requirements

Installation

Configuration

CLI install:

Rerunning it is safe.

To publish the configuration file by itself instead:

namespace and path must describe the same place: a directory holding one subdirectory per schema, named after it.

Usage

Scaffold a table enum beside it for every table in the database:

rules() states only what the schema itself constrains. Uniqueness, confirmation and any format the database does not enforce belong to the request:

Interfaces

implements names an interface every generated table enum declares — a single class-string, or a list of them. It defaults to null, which declares none:

The generator writes the clause and the imports it needs. Satisfying the interface is yours to do, on the trait above.

Checking for drift

Add the check to your pipeline. It names every difference and exits non-zero:

Both commands take --schema to select the schema, defaulting to App, plus --connection and --database to say where to read it from. Without them the default connection and its own database are read:

Agent development

The package registers an MCP server so coding agents can read how it is meant to be used. It requires laravel/mcp, and registers nothing without it.

Register it with your agent:

Three tools are exposed:

Point the handle somewhere else, or turn the server off, in config/db-model.php:

Development

composer check requires a coverage driver (Xdebug or pcov); without one Pest cannot satisfy the --min=100 gate.

The tests read a real MySQL schema. They create the database named by DB_DATABASE if it does not exist, and drop every table in it. Point them at a throwaway database — phpunit.xml defaults to testing_db_model on 127.0.0.1:3306:

License

MIT. See LICENSE.


All versions of db-model with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
illuminate/console Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zero-to-prod/db-model contains the following files

Loading the files please wait ...