PHPackages                             php-soft/laravel-base - 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. php-soft/laravel-base

ActiveProject

php-soft/laravel-base
=====================

The Laravel Framework.

11.8kPHP

Since Nov 2Pushed 10y ago7 watchersCompare

[ Source](https://github.com/php-soft/laravel-base)[ Packagist](https://packagist.org/packages/php-soft/laravel-base)[ RSS](/packages/php-soft-laravel-base/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Base
============

[](#laravel-base)

[![Build Status](https://camo.githubusercontent.com/7c3710698016227fba7de421265ac4db1253cfd260214ccd8c88fd636fb97811/68747470733a2f2f7472617669732d63692e6f72672f7068702d736f66742f6c61726176656c2d626173652e737667)](https://travis-ci.org/php-soft/laravel-base)

Somes utilities for Laravel 5.x

1. Middleware convert input camelCase to snakecase
2. Middleware validate

I. Installation
---------------

[](#i-installation)

Install via composer - edit your `composer.json` to require the package.

```
"require": {
    // ...
    "php-soft/laravel-base": "dev-master",
}
```

Then run `composer update` in your terminal to pull it in. Once this has finished, you will need to add the service provider to the `providers` array in your `app.php` config as follows:

```
'providers' => [
    // ...
    PhpSoft\Base\Providers\BaseServiceProvider::class,
]
```

II. Usage
---------

[](#ii-usage)

### 1. Middleware convert input camelCase to snakecase

[](#1--middleware-convert-input-camelcase-to-snakecase)

To use the middlewares you will have to register them in app/Http/Kernel.php under the `$routeMiddleware` property:

```
protected $routeMiddleware = [
    ...
    'camelToSnake'       => \PhpSoft\Base\Middleware\CamelToSnake::class,
];
```

Add routes in `app/Http/routes.php`

```
Route::group(['middleware'=>'camelToSnake'], function() {

   // Your route
});
```

### 2. Validate

[](#2-validate)

This middleware is used to check validate for fields on different applications which use this package.

Add route middlewares in app/Http/Kernel.php

```
protected $routeMiddleware = [
    // ...
    'validate'   => \PhpSoft\Base\Middleware\Validation::class,
];
```

Usage

```
Route::post('/user', ['middleware'=>'validate: App\Http\Validators\UserValidate',
    function () {
        //
    }
]);
```

With `App\Http\Validators\UserValidate`, it's class which you need to declare in route. This class is used to declare rules to validate.

You can also use other class to declare rules for validate in your application but It have to implements `PhpSoft\Base\Validation\Contract` class.

For example, I declared rules in `App\Http\Validators\UserValidate` class as follows:

```
use PhpSoft\Base\Validation\Contract;

/**
 * User Validate
 *
 * return array
 */
class UserValidate implements Contract
{
    /**
     * Custom validator
     *
     * @return boolean
     */
    public static function boot($request)
    {

        IlluminateValidator::extend('validate_name', function($attribute, $value, $parameters) {

                return $value == 'validate_name';
            }, 'The name is in valid.'
        );
    }

    /**
     * Declare rules
     *
     * @return array
     */
    public static function rules()
    {
        return [
            'name'     => 'required|max:255|validate_name',
            'email'    => 'required|email',
            'password' => 'required|confirmed|min:6'
        ];
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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.

### Community

Maintainers

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

---

Top Contributors

[![huytbt](https://avatars.githubusercontent.com/u/7126782?v=4)](https://github.com/huytbt "huytbt (5 commits)")[![gghoantt](https://avatars.githubusercontent.com/u/13842780?v=4)](https://github.com/gghoantt "gghoantt (3 commits)")[![toancong](https://avatars.githubusercontent.com/u/5398771?v=4)](https://github.com/toancong "toancong (1 commits)")

### Embed Badge

![Health badge](/badges/php-soft-laravel-base/health.svg)

```
[![Health](https://phpackages.com/badges/php-soft-laravel-base/health.svg)](https://phpackages.com/packages/php-soft-laravel-base)
```

PHPackages © 2026

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