PHPackages                             mannysoft/api-form-request - 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. [API Development](/categories/api)
4. /
5. mannysoft/api-form-request

ActiveLibrary[API Development](/categories/api)

mannysoft/api-form-request
==========================

Laravel package for extending FormRequest for REST API Request.

0.2(6y ago)12.0k21MITPHPPHP &gt;=7.2.0

Since May 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mannysoft/api-form-request)[ Packagist](https://packagist.org/packages/mannysoft/api-form-request)[ RSS](/packages/mannysoft-api-form-request/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (4)Used By (1)

API Form Request
================

[](#api-form-request)

Laravel package for extending FormRequest for REST API Request.

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

[](#installation)

Require this package with composer.

```
composer require mannysoft/api-form-request
```

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Usage
-----

[](#usage)

```
namespace App\Http\Requests\Api;

use Mannysoft\ApiFormRequest\ApiFormRequest;

class RegisterUser extends ApiFormRequest
{
    // Whether you want to use other status code other than 422.
    // You can use 400 also
    protected $statusCode = 422;

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'fullname' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
        ];
    }
}
```

Now you can use in your controller.

```
namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Api\RegisterUser;
use App\User;

class UserController extends Controller
{

    public function register(RegisterUser $request)
    {
        User::create([
            'fullname' => request('fullname'),
            'email' => request('email'),
            'password' => bcrypt(request('password')),
        ]);
    }
}
```

```
{
    "errors": [
        {
            "field": "email",
            "message": "The email has already been taken."
        },
        {
            "field": "password",
            "message": "The password confirmation does not match."
        }
    ]
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

2433d ago

PHP version history (2 changes)0.1.x-devPHP &gt;=7.0.0

0.2PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e7052870acdc2ec859177432893616bfdc226fa96009f1773269140ca9a5aa1?d=identicon)[mannysoft](/maintainers/mannysoft)

---

Top Contributors

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

---

Tags

apilaravelvalidation

### Embed Badge

![Health badge](/badges/mannysoft-api-form-request/health.svg)

```
[![Health](https://phpackages.com/badges/mannysoft-api-form-request/health.svg)](https://phpackages.com/packages/mannysoft-api-form-request)
```

PHPackages © 2026

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