PHPackages                             webappid/smartresponse - 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. [Templating &amp; Views](/categories/templating)
4. /
5. webappid/smartresponse

ActiveLibrary[Templating &amp; Views](/categories/templating)

webappid/smartresponse
======================

SmartResponse simplifies consistent response handling in Laravel: supports Blade, redirect with messages, and JSON format.

3.2.4(1y ago)16832MITPHPPHP &gt;=8.0

Since Jan 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/webappid/smartresponse)[ Packagist](https://packagist.org/packages/webappid/smartresponse)[ RSS](/packages/webappid-smartresponse/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (1)Versions (31)Used By (2)

SmartResponse
=============

[](#smartresponse)

**SmartResponse** is a lightweight Laravel helper library that simplifies returning consistent responses, whether in JSON format for APIs or HTML rendered via Blade views. It’s perfect for APIs and controller logic that need smart decision-making for response formats.

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require webappid/smartresponse
```

---

🚀 Usage Examples
----------------

[](#-usage-examples)

### ✅ Return a JSON Success Response

[](#-return-a-json-success-response)

Use this when building API endpoints that return JSON:

```
use Illuminate\Http\Request;
use WebAppId\SmartResponse\SmartResponse;

class SampleController
{
    public function store(Request $request, SampleService $service, SmartResponse $smartResponse)
    {
        try {
            $data = $service->create($request->all());
            return $smartResponse->created($data, 'Sample created');
        } catch (\Throwable $e) {
            return $smartResponse->handle($e);
        }
    }
}
```

**Response Output:**

```
{
  "status": "success",
  "response": {
    "message": "Sample created",
    "data": {
      // Your request data
    },
    "records_filtered": 0,
    "records_total": 0,
    "meta": null
  }
}
```

💬 Support
---------

[](#-support)

If you have any questions or feedback about this package, feel free to reach out:

- 📧 Email:
- 💬 Telegram: [@DyanGalih](https://t.me/DyanGalih)

---

🧘 Happy Coding
--------------

[](#-happy-coding)

SmartResponse helps you keep your controller code clean, consistent, and flexible.
Happy coding with SmartResponse!

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance49

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity77

Established project with proven stability

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

Recently: every ~8 days

Total

30

Last Release

370d ago

Major Versions

0.0.3 → 1.0.02019-01-22

1.2.3 → 2.0.02022-04-10

2.1.1 → 3.0.02025-07-08

PHP version history (4 changes)0.0.1PHP &gt;=7.1.0

1.1.2PHP &gt;=7.2.0

1.1.10PHP &gt;=7.3

2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/bccdf01afc153c118b1a7f3ee97e48fd04a8dfdfe9d2f4dabfe406ecf58d402e?d=identicon)[dyan.galih](/maintainers/dyan.galih)

---

Top Contributors

[![DyanGalih](https://avatars.githubusercontent.com/u/3088531?v=4)](https://github.com/DyanGalih "DyanGalih (36 commits)")

---

Tags

responsejsonlaravelbladeredirectsmartresponse

### Embed Badge

![Health badge](/badges/webappid-smartresponse/health.svg)

```
[![Health](https://phpackages.com/badges/webappid-smartresponse/health.svg)](https://phpackages.com/packages/webappid-smartresponse)
```

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)[djl997/blade-shortcuts

Blade Shortcuts is a library of handy Laravel Blade Directives.

411.1k3](/packages/djl997-blade-shortcuts)

PHPackages © 2026

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