Download the PHP package sukohi/form-request-appendable without Composer
On this page you can find all versions of the php package sukohi/form-request-appendable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sukohi/form-request-appendable
More information about sukohi/form-request-appendable
Files in sukohi/form-request-appendable
Download sukohi/form-request-appendable
More information about sukohi/form-request-appendable
Files in sukohi/form-request-appendable
Vendor sukohi
Package form-request-appendable
Short Description A Laravel package that allows you to append values to FormRequest.
License MIT
Package form-request-appendable
Short Description A Laravel package that allows you to append values to FormRequest.
License MIT
Please rate this library. Is it a good library?
Informations about the package form-request-appendable
FormRequestAppendable
A Laravel package that allows you to append values to FormRequest.
This package is maintained under Laravel 5.7.
Installation
composer require sukohi/form-request-appendable:1.*
Preparation
First, you need to make your own FormRequest file by artisan command like the bellow.
php artisan make:request TestRequest
And set FormRequestAppendable
there.
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Sukohi\FormRequestAppendable\FormRequestAppendable;
class TestRequest extends FormRequest
{
use FormRequestAppendable;
protected $appends = ['time'];
// Something ...
// Accessor
public function getTimeAttribute($values) {
return $values['hours'] .':'. $values['minutes'];
}
}
Now you have a value called time
that contains hours
and minutes
in FormRequest.
Usage
You can use the values as if they originally exist.
in FormRequest
public function rules()
{
return [
'time' => 'required|date_format:H:i',
];
}
in Controller
public function index(TestRequest $request) {
echo $request->time;
}
License
This package is licensed under the MIT License.
Copyright 2019 Sukohi Kuhoh
All versions of form-request-appendable with dependencies
PHP Build Version
Package Version
Requires
laravel/framework Version
~5.7|~6.0
The package sukohi/form-request-appendable contains the following files
Loading the files please wait ....