Download the PHP package ironcurtaindev/easy-doc without Composer

On this page you can find all versions of the php package ironcurtaindev/easy-doc. 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 easy-doc

EasyDoc 📚

Packagist Version Total Downloads

A lightweight, developer-friendly API documentation generator for Laravel.

Stop writing YAML manually. EasyDoc auto-generates beautiful Markdown documentation, OpenAPI (Swagger) specs, Postman collections, and even a fully typed TypeScript SDK directly from your Laravel codebase using a fluent, expressive API.


🚀 Features


🎯 Why Easy-Doc?

🏢 For Teams: The "Bus Factor" Solution

If your backend developer leaves, does the next person know how the API works? With Easy-Doc, documentation lives inside the code.

🛡️ Real-World Resilience

Projects get paused. Clients change requirements. Developers changes.

🧠👨‍💻 For Solo Devs: Your "External Brain"

Working alone? Easy-Doc acts as your memory.

It bridges the gap between "Code" and "Explanation".


📦 Installation

Install via Composer:

Stable Version (Recommended)

Development Version (Bleeding Edge)

📋 Requirements

Need Laravel 11/12 support? Use a pre-1.0 release line.

Publish the configuration (Optional):


⚙️ Configuration (Auto-Discovery)

Model Auto-Discovery

By default, EasyDoc scans your app/Models directory. You just need to ensure your models are standard Eloquent models.

Reusable Authentication Headers

Define headers that appear frequently across your API. Then reference them by name in your endpoints.

Then reference them in your attributes:

Or with the document() function:

Default Headers

Headers included in ALL endpoints automatically:

Tip: Use addDefaultHeaders: false in #[DocAPI] to skip default headers for a specific endpoint.


📖 Usage Guide

Since schemas are auto-discovered, you focus purely on Documenting Endpoints.

Scenario: A User has one Partner and many Places.

1. Document Your Endpoints 📝

Use the document() helper in your Controllers.

Scenario: User Registration (Auth)

Scenario: User Partner (One-to-One)

Demonstrates using setSuccessObject to automatically document a model response.

Scenario: User Places (One-to-Many & Pagination)

Demonstrates setSuccessPaginatedObject for paginated responses.


Alternative: PHP 8 Attributes 🏷️

New in v0.3! You can now define documentation using PHP 8 Attributes instead of the document() function. This keeps your documentation metadata outside the function body for cleaner code.

Benefits of Attributes:

Example: Login with Attributes

Available Attributes

Attribute Purpose Repeatable
#[DocAPI(...)] Main endpoint documentation No
#[DocParam(...)] Request body/query/path parameters Yes
#[DocHeader(...)] Request headers Yes
#[DocResponse(...)] Success and error response examples Yes
#[DocRequest(...)] Auto-document FormRequest rules No

🆕 Auto-Documenting FormRequests with #[DocRequest]

Stop repeating yourself! If you use Laravel's FormRequest for validation, you can automatically generate documentation parameters from your rules.

EasyDoc parses the rules() method and converts them into #[DocParam] entries automatically, including types and required status.

DocAPI Options (Complete Reference)

DocParam Options

DocHeader Options

DocResponse Options

Complete Real-World Example

Here's a production-ready example using all available attribute features:

Note: Both approaches (document() function and Attributes) are fully supported. Use whichever fits your coding style!

2. View Your Documentation 👁️

Once you have defined your endpoints, view them in the browser.

Make sure to enable the viewer in your .env:

Then visit:


🛠️ API Responses (Trait)

EasyDoc provides a convenient trait ApiResponses to standardize your API responses.

Step 1: Use the Trait in your Controller

Available Methods:

Method Usage Description
apiSuccess($data, $message, $status) return $this->apiSuccess($user, 'Created', 201); Returns standardized success structure.
apiSuccessList($list, $message) return $this->apiSuccessList($items, 'List retrieved'); Returns a list of items.
apiSuccessPaginated($paginator, $msg) return $this->apiSuccessPaginated($users); Returns paginated data with meta and links.
apiError($msg, $status, $data) return $this->apiError('Invalid input', 422); Returns standardized error structure.
apiNotFound($msg) return $this->apiNotFound('User not found'); Returns 404 error.
apiUnauthorized($msg) return $this->apiUnauthorized(); Returns 401 error.
apiForbidden($msg) return $this->apiForbidden(); Returns 403 error.

Standard Response Structure:


🧩 Advanced: Extra API Columns

Sometimes your API returns data that isn't a direct column in your database (e.g., computed attributes, relationships, or tokens). You can document these using the HasExtraApiColumns interface on your Model.


🚀 Generate Command

Run the artisan command to generate all formats:

This will generate:

Performance & Caching ⚡

In production, parsing Attributes and Reflection on every request can be slow. EasyDoc provides caching commands to optimize performance.

Cache Documentation: Serializes the parsed documentation to bootstrap/cache/easy-doc.php, bypassing the reflection process in subsequent requests.

Clear Cache: Removes the cached file.

Recommendation: Add php artisan easy-doc:cache to your deployment script.


License

The MIT License (MIT).


📚 Deep Dive Reference

Parameter Types & Validation

The Param class offers a rich set of validation and typing options.

Available Types:

File Uploads 📂

To document file uploads, use setConsumes and Param::TYPE_FILE.

TypeScript SDK Generation 🟦

EasyDoc can generate a fully typed TypeScript SDK for your frontend.

  1. Enable it in config/easy-doc.php:

  2. Auto-Discovery: Your Eloquent models in app/Models are automatically converted to TypeScript interfaces (e.g., interface User { ... }).

Advanced Configuration

Custom Response Wrapper

If your API wraps every response (e.g., inside data), configure it globally to keep your docs accurate.

Multiple Environments

Document your Staging and Production servers so users can switch between them in the UI.

Rate Limiting & Deprecation


🚀 Developer-Friendly Features (v0.4)

DocGroup - Controller-Level Defaults

Apply common settings to all endpoints in a controller. No more repeating group, version, tags on every method!

DocGroup Properties:

Property Description
group Default group for all methods
version Default API version
tags Default tags for all methods
consumes Default content types
headers Config header names for all methods
addDefaultHeaders Include default headers (default: true)
rateLimit Default rate limit
possibleErrors Common errors for all methods

DocError - Error Response Presets

Reference common error responses from config instead of writing them out every time.

Step 1: Define presets in config:

Step 2: Use in controllers:

Available Default Presets:


Param Templates - Reusable Parameter Definitions

Define common parameters once, reuse everywhere.

Step 1: Define templates in config:

Step 2: Use in controllers:

Override template values:


Comparison: Before vs After

`


All versions of easy-doc with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^13.4
illuminate/console Version ^13.4
illuminate/routing Version ^13.4
symfony/yaml Version ^7.0|^8.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 ironcurtaindev/easy-doc contains the following files

Loading the files please wait ...