I'm having a weird problem trying to validate the fields on a form with laravel. According to the documentation, in order to do so I need to do this:
Validator::make($this->$request->all(), $this->$validationRules)
But currently I'm getting this annoying message 'Cannot access empty property'.
I have tracked the error to this expression $this->$request->all()
, as it seems that all() property is not defined... Weird thing cause if I do, for instance something like $this->request->input('name')
I'll get the value sent by the input with name='name' correctly on my controller .
Why is that property seems to be empty? Is there anything I'm missing to create my validations properly?
Thanks!