Download the PHP package yeab/laravel-api-contract without Composer

On this page you can find all versions of the php package yeab/laravel-api-contract. 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-api-contract

Laravel API Contract

The ultimate "Write once. Generate everything." toolkit for Laravel APIs.

Latest Version on Packagist Total Downloads Build Status License


πŸ“– Introduction

Laravel API Contract is an advanced, fully automated architecture utility for Laravel applications. It statically analyzes your existing Laravel routes, controllers, Form Requests, and API Resources to automatically generate a comprehensive API Contract.

From this single source of truth, it instantly generates Swagger documentation, TypeScript interfaces, typed API clients, Postman collections, Markdown docs, PHPUnit feature tests, and backwards-compatibility reports.

🎯 Core Philosophy

"Write once. Generate everything."

You shouldn't have to write your validation rules in a Form Request, duplicate them in OpenAPI annotations, and then write them again as TypeScript interfaces for your frontend. Laravel API Contract eliminates this friction. Write clean, standard Laravel code, and let the package do the rest.

πŸ’‘ Why This Package Exists

Building APIs usually means maintaining parallel systems. When you update an endpoint in your controller, you also have to update your Postman collection, notify the frontend team to update their types, fix the Swagger annotations, and write the tests.

This causes friction, drift, and broken integrations. We built this package to ensure that your Laravel code is the only source of truth.

πŸ› οΈ Problems It Solves

✨ Features

πŸ—οΈ High-Level Architecture Overview

  1. Route Discovery Engine: Finds all API routes registered in your application.
  2. Controller Analysis Engine: Inspects your controller methods to determine logic and parameters.
  3. Form Request & Validation Analyzer: Parses rules() to determine expected input payloads and validation states.
  4. API Resource Analyzer: Parses your toArray() methods to determine the exact shape of your JSON responses.
  5. Contract Builder: Merges all analyzed metadata into a single, unified ApiContract JSON representation.
  6. Generators: Consumes the ApiContract to emit various artifacts.

πŸ“¦ Generated Outputs

Once your application is analyzed, you can generate:

πŸ“₯ Installation

Require the package via Composer. It is recommended to install it as a dev dependency unless you are generating contracts in production:

Optionally, publish the configuration file:

πŸš€ Quick Start

To instantly analyze your API and build the core contract file (usually written to storage/api-contract.json):

Now, you can generate everything else from it!

πŸ’» Basic Usage

The package works automatically by inspecting standard Laravel conventions.

Run php artisan api-contract:build, and the package will figure out exactly what /users accepts and what it returns!

πŸ› οΈ Available Artisan Commands

Command Description
api-contract:build Analyze the application and build the central api-contract.json file.
api-contract:swagger Generate an OpenAPI/Swagger v3.0 JSON specification.
api-contract:typescript Generate TypeScript interface definition files.
api-contract:client Generate a fully-typed TypeScript API client service.
api-contract:postman Generate a Postman v2.1 Collection JSON file.
api-contract:docs Generate human-readable Markdown documentation.
api-contract:tests Generate boilerplate PHPUnit feature tests.
api-contract:compare Compare two contract files and output a breaking-change report.

πŸ“š Documentation Index

For deep dives into configuration and advanced generator options, please refer to the documentation:

πŸ—ΊοΈ Roadmap

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Security Vulnerabilities

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

πŸ“„ License

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


All versions of laravel-api-contract with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/container Version ^11.0|^12.0|^13.0
illuminate/filesystem Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/validation Version ^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 yeab/laravel-api-contract contains the following files

Loading the files please wait ...