PHP code example of fredyhenaodev / lumen-form-request-url
1. Go to this page and download the library: Download fredyhenaodev/lumen-form-request-url library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fredyhenaodev / lumen-form-request-url example snippets
php
namespace App\Http\Request;
use Fredyhenaodev\Requests\FormRequestUrl;
class FindUserByIdRequest extends RequestUrl
{
/**
* Defining the URL parameters (`/stores/78/FredyHenao`) allows applying
* validation rules on them and allows accessing them like request data.
*
* @var array
*/
protected $urlParameters = [
'id',
'name'
];
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'id' => '