4 years ago

how i get image form user using auth controller at the time of registration

Posted 4 years ago by Mubashar

I do this in the following way and try to upload image but it not worked. Here is my AuthController code: $user= User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'nic'=>$data['nic'], 'contactNo'=>$data['contactNo'], 'CreditCardNo'=>$data['CreditCardNo'], 'country'=>$data['country'], 'role'=>$data['role'], ]); if(Input::file('image')){ $user=$data['id']; $imageName = $user->id . '_product.' . $user->file('image')->getClientOriginalExtension(); $imageCompletePath = '/images/'. $imageName ;

            base_path() . '/public/images/', $imageName);

        $user->update(array('image' => $imageCompletePath));

    return $user; 

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