4 months ago

Using hasFile() on RegistrationController gives error

Posted 4 months ago by codemode


I'm trying to add an image upload field on User's registration.

The RegistrationController's create function seems to take 'array' as an argument instead of 'request' Looks like :

protected function create(array $data)

So here, when i do :


When the register.blade.php has a simple file input field :

<input type="file" class="form-control @error('profilepic') is-invalid @enderror" name="profilepic" >

It given an error :

Call to a member function hasFile() on array

How can i call hasFile() on this function... and why is the parameter array instead of request here?

Many thanks!

Please sign in or create an account to participate in this conversation.