PHPackages                             oanhnn/laravel-handlers - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. oanhnn/laravel-handlers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

oanhnn/laravel-handlers
=======================

Using handler class instead of controller class in Laravel 5.5+ application

v1.0.1(6y ago)232MITPHPPHP ^7.1.3CI failing

Since Oct 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/oanhnn/laravel-handlers)[ Packagist](https://packagist.org/packages/oanhnn/laravel-handlers)[ Docs](https://github.com/oanhnn/laravel-handlers)[ RSS](/packages/oanhnn-laravel-handlers/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (5)Versions (8)Used By (0)

Laravel Handlers
================

[](#laravel-handlers)

[![Latest Version](https://camo.githubusercontent.com/61d762b447f31aa4d08eb716638d1706d84ad209d584e56cf16a0fb38fadd983/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f616e686e6e2f6c61726176656c2d68616e646c6572732e737667)](https://packagist.org/packages/oanhnn/laravel-handlers)[![Software License](https://camo.githubusercontent.com/d80b832e925c65c90f1c34640ddca2dd5d68e98d2ce1f7173e3c807f229623ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f616e686e6e2f6c61726176656c2d68616e646c6572732e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ef9952056e047170c4fe79bcb3eada650fc541b84cc9ad7c2736a5dfb56bcc8f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6f616e686e6e2f6c61726176656c2d68616e646c6572732f6d61737465722e737667)](https://travis-ci.org/oanhnn/laravel-handlers)[![Coverage Status](https://camo.githubusercontent.com/34936e778ce688d55cd81328ea6724e4c5fb569c9b310f9ec37dc7a4956728bb/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f6f616e686e6e2f6c61726176656c2d68616e646c6572732f6d61737465722e737667)](https://coveralls.io/github/oanhnn/laravel-handlers?branch=master)[![Total Downloads](https://camo.githubusercontent.com/65fbf465120cc63e0e75559393c440c2d99325df9a8f37f37c0f18ad542ad32d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f616e686e6e2f6c61726176656c2d68616e646c6572732e737667)](https://packagist.org/packages/oanhnn/laravel-handlers)[![Requires PHP](https://camo.githubusercontent.com/3ad2ae18832245a5811d30963f97bbf5d808374db270265737f6ca3dbd3a9ca3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d762f6f616e686e6e2f6c61726176656c2d68616e646c6572732e737667)](https://travis-ci.org/oanhnn/laravel-handlers)

Using handler class instead of controller class in Laravel 5.5+

Requirements
------------

[](#requirements)

- php &gt;=7.1.3
- Laravel 5.5+

> Laravel 6.0+ requires php 7.2+

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

[](#installation)

Begin by pulling in the package through Composer.

```
$ composer require oanhnn/laravel-handlers
```

### Laravel

[](#laravel)

After that, publish vendor's resources:

```
$ php artisan vendor:publish --tag=laravel-handlers-config
```

### Lumen

[](#lumen)

After that, copy the config file from the vendor directory:

```
$ cp vendor/oanhnn/laravel-handlers/config/handlers.php config/handlers.php
```

Update base handler class to your class in `config/handlers.php`.
Register the config file and the service provider in `bootstrap/app.php`:

```
$app->configure('handlers');

$app->register(Laravel\Handlers\ServiceProvider::class);
```

Usage
-----

[](#usage)

### Create handler class

[](#create-handler-class)

Create new handler class by run command

```
$ php artisan make:handler ShowProfile
```

You can use `--force` option to force create handler class (override existed class)

```
$ php artisan make:handler --force ShowProfile
```

### Configure

[](#configure)

You can change namespace of handler classes by config `namespace` in `config/handlers.php` file.

```
    'namespace' => '\\App\\Http\\Api',
```

You can change base handler class by config `base` in `config/handlers.php` file.

```
    'base' => '\App\Http\Controllers\Controller::class',
```

### Customize handler stub

[](#customize-handler-stub)

If you want customize stub file, please run:

```
$ php artisan vendor:publish --tag=laravel-handlers-stubs
```

Changelog
---------

[](#changelog)

See all change logs in [CHANGELOG](CHANGELOG.md)

Testing
-------

[](#testing)

```
$ git clone git@github.com/oanhnn/laravel-handlers.git /path
$ cd /path
$ composer install
$ composer phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email to [Oanh Nguyen](mailto:oanhnn.bk@gmail.com) instead of using the issue tracker.

Credits
-------

[](#credits)

- [Oanh Nguyen](https://github.com/oanhnn)
- [All Contributors](../../contributors)

License
-------

[](#license)

This project is released under the MIT License.
Copyright © [Oanh Nguyen](https://oanhnn.github.io/).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

Total

6

Last Release

2408d ago

Major Versions

0.2.0 → v1.0.02019-11-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/b32dfbbbf603d0317f2ab7ab33c7c7611e90f6701c5c84f07a8b537aa84e83f7?d=identicon)[oanhnn](/maintainers/oanhnn)

---

Top Contributors

[![oanhnn](https://avatars.githubusercontent.com/u/1757120?v=4)](https://github.com/oanhnn "oanhnn (10 commits)")

---

Tags

actionapi-handlercontrollerhandlerslaravellaravel-5-packagelaravel-packagelaravelpackagehandlercontrolleractions

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/oanhnn-laravel-handlers/health.svg)

```
[![Health](https://phpackages.com/badges/oanhnn-laravel-handlers/health.svg)](https://phpackages.com/packages/oanhnn-laravel-handlers)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

143165.6k](/packages/bensampo-laravel-embed)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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