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(9mo ago)16772MITPHPPHP &gt;=8.0

Since Jan 22Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/webappid/smartresponse)[ Packagist](https://packagist.org/packages/webappid/smartresponse)[ RSS](/packages/webappid-smartresponse/feed)WikiDiscussions master Synced 3d 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

44

—

FairBetter than 92% of packages

Maintenance58

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

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

279d 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

[aschmelyun/cleaver

A blazing-fast static site generator using Laravel's Blade templating engine

2961.0k](/packages/aschmelyun-cleaver)

PHPackages © 2026

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