PHPackages                             codersandip/laravel-api-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. codersandip/laravel-api-toolkit

ActiveLibrary

codersandip/laravel-api-toolkit
===============================

Standardize API development in Laravel applications.

1.0.0(6d ago)00MITPHPPHP ^8.1

Since Mar 16Pushed 6d agoCompare

[ Source](https://github.com/codersandip/laravel-api-toolkit)[ Packagist](https://packagist.org/packages/codersandip/laravel-api-toolkit)[ RSS](/packages/codersandip-laravel-api-toolkit/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel API Toolkit
===================

[](#laravel-api-toolkit)

A professional Laravel package to help standardize API development in your applications. It handles standardized JSON responses, auto-formatting pagination, API versioning, and exception formatting.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require codersandip/laravel-api-toolkit
```

Optionally, you can publish the config file with:

```
php artisan vendor:publish --tag="api-toolkit-config"
```

Configuration
-------------

[](#configuration)

This is the contents of the published config file:

```
return [
    'default_api_version' => 'v1',

    'response_structure' => [
        'status' => 'status',
        'message' => 'message',
        'data' => 'data',
        'meta' => 'meta',
        'pagination' => 'pagination',
        'errors' => 'errors',
    ],

    'pagination_enabled' => true,
];
```

Features and Usage
------------------

[](#features-and-usage)

### 1. Standard API Responses

[](#1-standard-api-responses)

The package provides the `HasApiResponse` trait. Use it in your base `Controller` or specialized API controllers:

```
