PHPackages                             agrodep/laravel-api-response - 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. [API Development](/categories/api)
4. /
5. agrodep/laravel-api-response

ActiveLibrary[API Development](/categories/api)

agrodep/laravel-api-response
============================

Response util for Laravel

v1.1(4mo ago)0191MITPHPPHP ^8.1|^8.2|^8.3

Since Oct 23Pushed 4mo agoCompare

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

READMEChangelog (2)Dependencies (3)Versions (3)Used By (1)

Laravel API Responses
=====================

[](#laravel-api-responses)

Laravel API Response api uchun moslangan bo‘lib, mijoz javobni JSON shaklida qaytaruvchi va unga shakl berib jo‘natuvchi kutubxona.

Laravel API Response is a package that helps to provide and render a consistent HTTP JSON responses to API calls as well as converting and formatting exceptions to JSON responses.

Talablar (Requirements)
-----------------------

[](#talablar-requirements)

- PHP ^8.1
- Laravel ^10 | ^11

Talqinlar mutonosibligi (Version Compatibility)
-----------------------------------------------

[](#talqinlar-mutonosibligi-version-compatibility)

LaravelLaravel API Response10.x1.x11.x1.2.x12.x1.3.xO‘rnatish (Installation)
------------------------

[](#ornatish-installation)

Install the package via composer:

```
composer require agrodep/laravel-api-response
```

Ishlatish (Usage)
-----------------

[](#ishlatish-usage)

RestResponse trait faylini asosiy Controller fayliga yoki kerakli Controller fayliga qo‘shish
(Add RestResponse trait to app module Controller file or any controller which is needed)

```
use Agrodep\ApiResponse\Responses\RestResponse;

class Controller extends Controller {
    use RestResponse;
}

...

class UserController extends Controller {
    public function show() {
        return $this->success([
            'user' => new User();
        ]);
    }
}
```

### Mavjud funksiyalar (Available functions)

[](#mavjud-funksiyalar-available-functions)

Nomi (name)Izoh (description)StatussuccessMuvaffaqiyatli200createdMuvaffaqiyatli201failXatolik yuz berganda\[400\]errorIchki xatolik500unAuthorizedManzilga ruxsat yo‘q\[401\]resultJavobda raqam va satrlar moslangan200paginatedSahiflangan ro‘yxat200pagedSahiflangan ro‘yxat (qo‘shimcha maydonlari bilan)200### Sovg‘a (Bonus)

[](#sovga-bonus)

This package also provided RestRequest to return json response Request validations

```
use Agrodep\ApiResponse\Requests\RestRequest;

// class UserRequest extends FormRequest - x
class UserRequest extends RestRequest {

}
```

PaginationRequest

```
use Agrodep\ApiResponse\Requests\PaginationRequest;

// class UserRequest extends FormRequest - xxx
class UserRequest extends PaginationRequest {

}
```

### Kengaytirish (Extend)

[](#kengaytirish-extend)

```
use Agrodep\ApiResponse\Requests\BuilderPaginator;

class UserService {

    public function all() {
        // Paginate users
        $users = User::query()->paginate();
        $items = $users->items();

        // Change content of paginated list
        $data = collect($items)->map(function(User $user) {
            return [
                'id' => $user->id,
                'name' => $user->name,
            ];
        });

        return new BuilderPaginator($users, $data);
    }
}

class UserController extends Controller {
    ...

    public function show() {
        $users = $this->service->all();

        // paged/paginated
        return $this->paged('users', $users, []);
    }
}
```

Foydalanilgan manbalar (References)
===================================

[](#foydalanilgan-manbalar-references)

- [Testbench](https://packages.tools/testbench) Laravel Testing Helper for Packages Development

Foydali havolalar (Links)
=========================

[](#foydali-havolalar-links)

- [Create Laravel package](https://laravel-news.com/building-your-own-laravel-packages)
- [Create package](https://medium.com/@prevailexcellent/how-i-created-my-third-laravel-package-step-by-step-guide-ad3fb0da5399)

###  Health Score

37

—

LowBetter than 84% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

149d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb14350ebfc332ea1d156bbcbc0a2e7e3c9e57f51c5c8ee6d37da1f6d70f456b?d=identicon)[DilmurodQurbonboyev](/maintainers/DilmurodQurbonboyev)

---

Top Contributors

[![DilmurodQurbonboyev](https://avatars.githubusercontent.com/u/75987687?v=4)](https://github.com/DilmurodQurbonboyev "DilmurodQurbonboyev (2 commits)")

---

Tags

responsephpapilaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agrodep-laravel-api-response/health.svg)

```
[![Health](https://phpackages.com/badges/agrodep-laravel-api-response/health.svg)](https://phpackages.com/packages/agrodep-laravel-api-response)
```

###  Alternatives

[flugger/laravel-responder

A Laravel Fractal package for building API responses, giving you the power of Fractal and the elegancy of Laravel.

8921.5M4](/packages/flugger-laravel-responder)[obiefy/api-response

Simple Laravel package to return Json responses.

17324.4k](/packages/obiefy-api-response)[kennedy-osaze/laravel-api-response

Renders consistent HTTP JSON responses for API-based projects

664.5k](/packages/kennedy-osaze-laravel-api-response)[wayofdev/laravel-symfony-serializer

📦 Laravel wrapper around Symfony Serializer.

2112.1k](/packages/wayofdev-laravel-symfony-serializer)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.1k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
