Download the PHP package wibesoft-company/laravel-request-default without Composer
On this page you can find all versions of the php package wibesoft-company/laravel-request-default. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wibesoft-company/laravel-request-default
More information about wibesoft-company/laravel-request-default
Files in wibesoft-company/laravel-request-default
Package laravel-request-default
Short Description A Laravel library to set default values for request parameters.
License MIT
Homepage https://github.com/wibesoft-company/laravel-request-default
Informations about the package laravel-request-default
LaravelRequestDefault README
Introduction
LaravelRequestDefault is a Laravel library designed to enhance Laravel Requests by allowing developers to set default values for request parameters. This library is particularly useful in scenarios where certain request parameters may not be provided but are needed for the application logic to function correctly. It seamlessly integrates with Laravel's existing request validation system, making it a convenient addition to any Laravel project.
Features
- Default Value Setting: Easily set default values for any request parameters.
- Seamless Integration: Works coherently with Laravel's validation and request handling.
- Flexible Configuration: Define defaults for various request types within your application.
Installation
To install LaravelRequestDefault, you need to require the package via Composer. Run the following command in your terminal:
Usage
Basic Usage
After installing the package, use the InputDefaulter
trait in your form request classes. Here's an example:
Defining Defaults
Define your default values in the defaults
method of your form request. The defaults
method should return an associative array where the keys are the request parameters and the values are their respective defaults.
License
LaravelRequestDefault is open-sourced software licensed under the MIT license.
For more information, please visit the project homepage.