lumen-form-request icon indicating copy to clipboard operation
lumen-form-request copied to clipboard

Call to a member function parameter() on array

Open mohammadgh1370 opened this issue 4 years ago • 1 comments

hi, thank you for this package

this error occured for me

Call to a member function parameter() on array

get id from route same below:

return[
'name'          => 'unique:roles,name,' . $this->route('id'),
];

but $this->route() return array

mohammadgh1370 avatar Jan 07 '21 08:01 mohammadgh1370

hi

use this function overwrite to class

public function route($param = null, $default = null)
    {
        $route = ($this->getRouteResolver())();

        if (is_null($route) || is_null($param)) {
            return $route;
        }

        return Arr::get($route[2], $param, $default);
    }

mohammadgh1370 avatar Jan 07 '21 09:01 mohammadgh1370