PHPackages                             devianl2/tenant-support - 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. devianl2/tenant-support

ActiveLibrary

devianl2/tenant-support
=======================

Microservice support package

1.0.13(3y ago)0127MITPHP

Since Feb 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/devianl2/tenant-support)[ Packagist](https://packagist.org/packages/devianl2/tenant-support)[ RSS](/packages/devianl2-tenant-support/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (2)Versions (15)Used By (0)

Tenant Support
==============

[](#tenant-support)

Tenant support is a laravel package that simplify and focuses on business function development.

For each microservice development, you need to follow instruction below to ensure the application is standardize.

Step 1:
-------

[](#step-1)

Install from composer

```
composer require devianl2/tenant-support
```

Run the following command for to export error view template

```
php artisan vendor:publish --provider="Tenant\Auth\TenantSupportProvider"
```

Go to App/Provider/RouteServiceProvider.php and modify rate limit to 600

```
protected function configureRateLimiting()
    {
        RateLimiter::for('api', function (Request $request) {
            return Limit::perMinute(600)->by(optional($request->user())->id ?: $request->ip());
        });
    }
```

Step 2:
-------

[](#step-2)

Go to laravel project / app / Exceptions / Handler.php and modify from

```
class Handler extends ExceptionHandler {
protected $dontReport = [
        //
    ];
    ....
}
```

to

```
class Handler extends ExHandler {
// remove all other functions and variables (Exhandler already included all that exceptions)
protected $dontReport = [
        //
    ];
}
```

Step 3:
-------

[](#step-3)

All controllers that required API return, use the traits ApiResponse.php. E.g:

```
import Tenant\Support\Traits\ApiResponse
class UserController extends Controller {
    use ApiResponse;
}
```

\##*functions*

```
public function successResponse($data, $statusCode = Response::HTTP_OK)
    {
        return response($data, $statusCode)->header('Content-Type', 'application/json');
    }
    public function errorResponse($errorMessage, $statusCode)
    {
        return response()->json(['error' => $errorMessage, 'error_code' => $statusCode], $statusCode);
    }
    public function errorMessage($errorMessage, $statusCode)
    {
        return response($errorMessage, $statusCode)->header('Content-Type', 'application/json');
    }
```

Step 4:
-------

[](#step-4)

All repositories that required paginate, use the traits EloquentPaginate.php. E.g:

```
import Tenant\Support\Traits\EloquentPaginate
class UserModel extends Model {
    use EloquentPaginate;
}
```

Sample to use the EloquentPaginate:

```
$templates  =   QuestionTemplate::with([
            'sections'
        ]);

        if (array_key_exists('search', $query) && !empty($query['search']))
        {
            $templates =   $templates->where('title', 'LIKE', '%' . $query['search'] .'%');
        }

        return $this->execute($templates, $paginate, $limit);
```

\##*params*\_

1. Query builder is referring eloquent query
2. $paginate is true/false
3. $limit is int (Minimum 1)

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Recently: every ~26 days

Total

14

Last Release

1390d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/258988219cf511bbd9c2809a6ba1653006dee578e2db26cb813aa99f6a24a319?d=identicon)[devianl2](/maintainers/devianl2)

---

Top Contributors

[![devianl2](https://avatars.githubusercontent.com/u/23150573?v=4)](https://github.com/devianl2 "devianl2 (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devianl2-tenant-support/health.svg)

```
[![Health](https://phpackages.com/badges/devianl2-tenant-support/health.svg)](https://phpackages.com/packages/devianl2-tenant-support)
```

PHPackages © 2026

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