Download the PHP package diephp/laravel-resources-typescript without Composer

On this page you can find all versions of the php package diephp/laravel-resources-typescript. 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-resources-typescript

Total Downloads Latest Stable Version License

Laravel Resources to TypeScript

Version 2.0.2 of the package.

Generate TypeScript interface and type definitions from standard Laravel resources without rewriting your API layer into DTO-only abstractions.

The package analyzes native Laravel resources and can extract structure from:

If a type cannot be determined safely, it falls back to any.

Project Story

This is a lightweight package for development-time generation of TypeScript interfaces from standard Laravel resources for Laravel 9, 10, 11, 12, 13 and PHP 8.1+.

It was originally developed to satisfy a requirement to minimize the use of heavy packages in the Restsify project and then opened for everyone who prefers to keep server resources fully under control.

What's New in 2.0.2

Maintenance release, no API changes and no change to supported Laravel or PHP versions:

What's New in 2.0

Compatibility

Laravel is not a dependency of this package. The framework is only needed for the artisan command and the service provider, so it is listed in require-dev (for this repository's own test suite) and in suggest. Neither of those affects your project: Composer ignores a library's require-dev, so the package installs next to any Laravel version and never forces an upgrade.

The only production dependency is nikic/php-parser.

Security and dependencies

The package has no runtime dependency on laravel/framework, so no framework advisory can reach a consumer project through it. Advisories that automated scanners report against this repository refer to the framework version used by the package's own test suite, not to anything shipped to users.

To keep that noise down without narrowing Laravel support:

Upgrading from 1.x

Version 2.0 is mostly source-compatible in usage, but there are a few important changes.

Breaking changes

What remains compatible

Installation

For 2.0, your project must run on PHP 8.1+.

Publish the config if you want to customize paths:

Usage

Run the generator:

Default config:

Supported Type Sources

The generator can infer structure from:

Examples

1. Plain resource with casts

2. Resource with ArrayShape

3. Resource with PHPDoc array shape

4. DTO or model-like class with typed public properties

5. Model with PHPDoc properties or $fillable

6. Resource built through a variable

7. Enum field inside a resource

8. Resource that returns enum as root value

Notes

Search Keywords

If you are publishing or searching for the package, the main focus of 2.0 is:

Testing

Check dependencies against the security advisory database:

License

MIT


All versions of laravel-resources-typescript with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nikic/php-parser Version ^5.4
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 diephp/laravel-resources-typescript contains the following files

Loading the files please wait ...