vendredi 17 novembre 2017

FormRequest all() property causes Reflection exception in Laravel 5.5

Issue with laravel 5.5

If I use the all() property in formRequest class, It throws reflection exception

ReflectionException
Class App\Http\Requests\CashDepositRequest does not exist

but when I remove the all() property, it works well.

This was not an issue in laravel 5.4

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CashDepositRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }
    public function rules()
    {
        return [
            'amount' => 'bail|required|numeric',
            'gateway' => 'bail|required|exists:gateways,id',
        ];
    }
    //This property causes reflection exception
    public function all()
    {
        $this->attributes = parent::all();
        $this->attributes['amount'] = $this->attributes['amount'];
        return $this->attributes;
    }
}

Is there any other way to modify user input in the formRequest class in laravel 5.5?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2is6fMZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire