PHPackages                             jooservices/laravel-controller - 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. jooservices/laravel-controller

ActiveLibrary[API Development](/categories/api)

jooservices/laravel-controller
==============================

Laravel API controller foundation for standardized JSON responses, pagination, status endpoints, trace IDs, and custom formatters.

v1.4.1(1w ago)0298[5 PRs](https://github.com/jooservices/laravel-controller/pulls)MITPHPPHP ^8.5

Since Feb 3Pushed 3w agoCompare

[ Source](https://github.com/jooservices/laravel-controller)[ Packagist](https://packagist.org/packages/jooservices/laravel-controller)[ RSS](/packages/jooservices-laravel-controller/feed)WikiDiscussions develop Synced today

READMEChangelog (6)Dependencies (48)Versions (23)Used By (0)

JOOservices Laravel Controller
==============================

[](#jooservices-laravel-controller)

[![codecov](https://camo.githubusercontent.com/aec09651c5c77a2276cf36d711644c4496a4ab8ff950cfdd45060a3c4d2db088/68747470733a2f2f636f6465636f762e696f2f67682f6a6f6f73657276696365732f6c61726176656c2d636f6e74726f6c6c65722f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/jooservices/laravel-controller)[![CI](https://github.com/jooservices/laravel-controller/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/jooservices/laravel-controller/actions/workflows/ci.yml)[![OpenSSF Scorecard](https://camo.githubusercontent.com/af310edc338d01c93f896d33d5c05b2185c7da756ab07968261ee297ffc3a4b4/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f6a6f6f73657276696365732f6c61726176656c2d636f6e74726f6c6c65722f6261646765)](https://securityscorecards.dev/viewer/?uri=github.com/jooservices/laravel-controller)[![PHP Version](https://camo.githubusercontent.com/2788132aa1e54031a6c94edcbf8688566d3e18cb5492cd1766836f74a24b27b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e352532422d626c75652e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/0ab88f4711720066cc684cc7408c3754f8e45e53249339e59049ad93ad6dfb5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6f73657276696365732f6c61726176656c2d636f6e74726f6c6c6572)](https://packagist.org/packages/jooservices/laravel-controller)

**JOOservices Laravel Controller** is a Laravel API controller foundation for standardized JSON response envelopes, resource-friendly helpers, pagination metadata, status endpoints, trace IDs, and formatter-based response customization.

Composer package: `jooservices/laravel-controller`

Current release: `1.3.0`

Features
--------

[](#features)

- base API controller helpers for success, error, validation, status, and no-content responses
- Laravel `JsonResource` and `ResourceCollection` friendly response helpers
- standardized response envelope with configurable keys
- length-aware, cursor, and offset pagination helpers
- trace ID support through a configurable request header
- optional status endpoint with version, environment, maintenance, and health-check metadata
- custom `ResponseFormatter` contract for teams that need a different top-level JSON shape
- optional exception response helper for common Laravel exceptions
- read-only `php artisan laravel-controller:doctor` diagnostics

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

[](#installation)

```
composer require jooservices/laravel-controller
```

Publish Config
--------------

[](#publish-config)

```
php artisan vendor:publish --provider="JOOservices\LaravelController\Providers\LaravelControllerServiceProvider" --tag="config"
```

Optional translations:

```
php artisan vendor:publish --provider="JOOservices\LaravelController\Providers\LaravelControllerServiceProvider" --tag="laravel-controller-lang"
```

Quick Start
-----------

[](#quick-start)

Use the package at the controller boundary. Keep request validation, business logic, and persistence in your application layers:

```
