New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mayoz/lumen-form-request

Adopt the Laravel Form Request to Lumen framework.
2,519 2

Larablocks Analysis

mayoz/lumen-form-request works with Laravel 7 and 8 (latest release v2.0.0, Dec 22, 2020), all past end of life (the last on Jan 24, 2023): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 7 and 8, past end of life since Jan 24, 2023
  • No release in the last 12 months (last: Dec 22, 2020)
  • 0 downloads a month (needs 10,000)
  • 2 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Dec 22, 2020.
  • No releases in the last 12 months.
  • First released: Apr 28, 2020.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require mayoz/lumen-form-request
Latest Version:v2.0.0
PHP:^7.3|^8.0
Laravel:7 · 8
License:MIT
Last Updated:Dec 22, 2020
Links: GitHub  ·  Packagist
Maintainer: mayoz

Lumen Form Request

Latest Version on Packagist Software License StyleCI

Adopt the Laravel Form Request to Lumen framework.

Installation

You can install the package via composer:

composer require mayoz/lumen-form-request

Register the service provider in your boostrap/app.php configuration file:

$app->register(Illuminate\Foundation\Providers\FormRequestServiceProvider::class);

Usage

Let's continue the official Laravel's documantation.

Format Validation

If you want to format the verification messages, follow these steps:

Firstly import the ValidationException class:

use Illuminate\Validation\ValidationException;

Add (if need) the dontReport list:

/**
 * A list of the exception types that should not be reported.
 *
 * @var array
 */
protected $dontReport = [
    // ...
    ValidationException::class,
];

And finally update the render method:

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Throwable  $exception
 * @return \Symfony\Component\HttpFoundation\Response
 *
 * @throws \Throwable
 */
public function render($request, Throwable $exception)
{
    if ($exception instanceof ValidationException) {
        return $this->convertValidationExceptionToResponse($exception, $request);
    }

    return parent::render($request, $exception);
}

/**
 * Create a response object from the given validation exception.
 *
 * @param  \Illuminate\Validation\ValidationException  $e
 * @param  \Illuminate\Http\Request  $request
 * @return \Symfony\Component\HttpFoundation\Response
 */
protected function convertValidationExceptionToResponse(ValidationException $e, $request)
{
    if ($e->response) {
        return $e->response;
    }

    return response()->json([
        'message' => $e->getMessage(),
        'errors' => $e->errors(),
    ], $e->status);
}

License

This package is licensed under The MIT License (MIT).

Related Packages

dadaabc/laravel-components

Components for Laravel or Lumen

196 0
hollisho/lumen-request

http Request For Lumen

10 0
chhw/form-request

This package can use form request just as Laravel do.

312 2
inpin/backend-foundation

Backend (Laravel) foundation base classes

45 0
chujc/validation-support

Laravel Lumen 字段验证 支持

35 2

Version History

Version Released PHP Laravel License
v2.0.0 ^7.3|^8.0 ^7.0|^8.0 MIT
v1.0.0 ^7.3 ^7.0|^8.0 MIT