PHPackages                             ymigval/laravel-sl-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. ymigval/laravel-sl-response

ActiveLibrary[API Development](/categories/api)

ymigval/laravel-sl-response
===========================

A Laravel package for streamlined API response formatting and management, ensuring consistency and adherence to API standards. Simplify error handling and customize response formats with ease.

1.0.2(1y ago)10257MITPHPPHP &gt;=8.0

Since Nov 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ymigval/laravel-sl-response)[ Packagist](https://packagist.org/packages/ymigval/laravel-sl-response)[ RSS](/packages/ymigval-laravel-sl-response/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Laravel API Response Formatter
==============================

[](#laravel-api-response-formatter)

The `ymigval/laravel-sl-response` package simplifies API response management in Laravel applications. It allows you to structure and format API responses with ease, ensuring consistency and adherence to API standards.

### Key Features

[](#key-features)

- **Consistent Responses**: Generate API responses with a standardized structure, including status codes, messages, and data, providing a uniform and professional look to your API.
- **Error Handling**: Efficiently manage error responses with detailed error messages, appropriate status codes, and response formatting that complies with best practices.
- **Customization**: Tailor the response format to suit your project's specific needs, offering flexibility to meet various API requirements.
- **Laravel Integration**: Seamlessly integrates with Laravel, enhancing Laravel's response system with additional features.
- **Time Efficiency**: Reduce the development effort required for consistent API responses, allowing you to focus on your application's core functionality rather than response formatting.

The `ymigval/laravel-sl-response` package empowers you to build and maintain professional, reliable APIs that meet industry standards. Whether you're developing a new API or improving an existing one, this package is an invaluable addition to your Laravel toolkit.

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

[](#installation)

You can install the package via Composer:

```
composer require ymigval/laravel-sl-response
```

You can publish the configuration file using the following command:

```
php artisan vendor:publish --tag="slresponse"
```

Usage
-----

[](#usage)

Response from a route or controller method.

```
use Ymigval\LaravelSLResponse\Facades\SLResponse;
use Ymigval\LaravelSLResponse\Exceptions\SLException;

// Collection of users
return SLResponse::ok(User::all());

// A User resource
return SLResponse::ok(new UserResource(User::find(1)));

// If you want to disable the outermost wrapping.
return SLResponse::ok(UserResource::collection(User::paginate(10)))
        ->withoutWrapping();

// Attach additional messages.
return SLResponse::ok(User::find(6)->isAdmin())
        ->withMessage("This user is an admin");

// Return an error response.
return SLResponse::error('Limit exceeded');

// Additionally, you can add an error code as the second argument.
return SLResponse::error('Limit exceeded', '3748');

// Throw an exception
throw new SLException('This is a message.');
```

Changelog
---------

[](#changelog)

Please refer to the [CHANGELOG](CHANGELOG.md) for more information about recent changes.

License
-------

[](#license)

The MIT License (MIT). For more information, please see the [License File](LICENSE).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~209 days

Total

3

Last Release

547d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68402880?v=4)[Yordan](/maintainers/ymigval)[@ymigval](https://github.com/ymigval)

---

Top Contributors

[![ymigval](https://avatars.githubusercontent.com/u/68402880?v=4)](https://github.com/ymigval "ymigval (14 commits)")

---

Tags

apiformatformattingjsonlaravelresponsestandardresponsejsonapilaravelformatstandardformatting

### Embed Badge

![Health badge](/badges/ymigval-laravel-sl-response/health.svg)

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

###  Alternatives

[nilportugues/laravel5-json-api-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast

311.5k](/packages/nilportugues-laravel5-json-api-dingo)[nilportugues/laravel5-haljson

Laravel 5 HAL+JSON API Transformer Package

151.0k](/packages/nilportugues-laravel5-haljson)[nicklaw5/larapi

A simple Laravel 5 class for handling json api responses.

111.5k](/packages/nicklaw5-larapi)

PHPackages © 2026

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