webregul / lumen-form-request
Adopt the Laravel Form Request to Lumen framework.
v2.0.6
2023-08-03 15:46 UTC
Requires
- php: ^8.0
- illuminate/auth: ^10.0
- illuminate/console: ^10.0
- illuminate/container: ^10.0
- illuminate/contracts: ^10.0
- illuminate/http: ^10.0
- illuminate/support: ^10.0
- illuminate/translation: ^10.0
- illuminate/validation: ^10.0
Requires (Dev)
- mockery/mockery: ^1.3.1
- phpunit/phpunit: ^8.4|^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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).