flipboxstudio / lumen-generator

A Lumen Generator You Are Missing
https://packagist.org/packages/flipbox/lumen-generator
MIT License
824 stars 126 forks source link

Update the request stub to comply with the parent class definition #108

Closed jorgemudry closed 3 years ago

jorgemudry commented 3 years ago

What does this Pull Request Do?

It updates the request stub in order to be compatible with its parent class definition.

How should this be manually tested?

  1. require this branch with composer: composer require flipbox/lumen-generator:dev-update_request_stub
  2. install and configure the required library for form requests: https://github.com/ssi-anik/form-request
  3. generate a new form request: php artisan make:request MyFormRequest
  4. you should end up with a new form request looking like this:
<?php

namespace App\Http\Requests;

use Anik\Form\FormRequest;

class MyFormRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    protected function authorize(): bool
    {
        return false;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    protected function rules(): array
    {
        return [
            //
        ];
    }
}
  1. implement the form request and you shouldn't get any error.

Any background context you want to provide?

N/A

What are the relevant issues?

Requests generated incorrectly

Any extra info?

mcfly