Download the PHP package romegasoftware/laravel-schema-generator without Composer

On this page you can find all versions of the php package romegasoftware/laravel-schema-generator. 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 laravel-schema-generator

Laravel Schema Generator

Generate TypeScript Schema validation schemas from your Laravel validation rules. This package supports Laravel FormRequest classes, Spatie Data classes, and custom validation classes through an extensible architecture.

It will generate Zod schema out of the box, but can be extended for different schema generators.

Features

Installation

Ensure Zod v4 is installed

Optional Packages

For additional features, install these optional packages:

Configuration

To publish the configuration file, run:

This will create a config/laravel-schema-generator.php file where you can customize output paths, formats, and integration settings.

Generating Separate Files

By default, all schemas are generated into a single TypeScript file. You can configure the package to generate separate files for each schema (e.g., UserSchema.ts, PostSchema.ts) by enabling separate_files in the configuration.

When enabled, the generator will:

  1. Create individual .ts files for each schema.
  2. Automatically resolve and inject imports for dependent schemas (e.g., if UserSchema references AddressSchema).

Quick Start

  1. Add the attribute to your Laravel validation classes:

  2. Generate the schemas:

  3. Use in TypeScript:

Documentation

For complete documentation, configuration options, advanced features, and examples, visit:

📚 Official Documentation Coming Soon

Custom Schema Overrides

When you need to keep bespoke Laravel validation logic but still describe the TypeScript shape, provide a literal override using the fluent helper. Prefix the snippet with . when you want to append behaviour to the inferred Zod builder instead of replacing it entirely:

Because the override begins with ., the generator keeps the inferred base (z.array(...)) and simply appends your refinement. The callable passed to append() receives the JSON-encoded message as its first argument (and the raw message as a second argument if you declare it). When you want to replace the builder outright, omit the leading dot and provide the complete Zod expression (for example z.array(z.object({ ... }))).

Prefer dedicated rule objects? Implement SchemaAnnotatedRule and reuse the same fluent API with the provided trait:

Both approaches surface the schema fragment directly alongside the validation logic and are picked up automatically by the generator for FormRequests and Spatie Data classes.

Contributing

Please see CONTRIBUTING for development setup and contribution guidelines.

License

The MIT License (MIT). Please see License File for more information.

Credits


All versions of laravel-schema-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0|^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 romegasoftware/laravel-schema-generator contains the following files

Loading the files please wait ...