webregul/lumen-form-request

Adopt the Laravel Form Request to Lumen framework.

v2.0.6 2023-08-03 15:46 UTC

This package is auto-updated.

Last update: 2024-05-03 18:10:37 UTC


README

Latest Version on Packagist Software License StyleCI

Adopt the Laravel Form Request to Lumen framework. Используется namespace Illuminate\Foundation\ для совместимости со Scribe

Installation

You can install the package via composer:

composer require webregul/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.

По дефолту добавлены кастомизированные сообщения об ошибках. Для их отключения в Request классе объявить:

public static bool $disableDefaultMessages = false;

либо использовать метод messages() Для добавления собственных ошибок без отключения дефолтных:

public static array $messages = [
    'rule' => 'custom message'; //будет добавлено к сообщениям, либо заменит дефолтное при совпадении правила
];

License

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