title: How to solve error "Invalid view" in registration function?
body: <p>I am having an error during the registration of a recruiter for the application I am working for</p>
  
  <p>here is the error I am having in the network while sending the form information :</p>
  
  <p>code:500
  error: "Invalid view."
  message: "Erreur lors de la création du compte"</p>
  
  <p>here is the code</p>
  
  <pre><code>  public function personnal(AccountCreateRequest $request)
  {
      try {
          $http = new \GuzzleHttp\Client;
          $exists = false;
          $userData = $request-&gt;input('user');
          $userData['password'] = bcrypt($userData['password']);
          $userData['gender'] = ($userData['title'] === 'M.') ? 'm' : 'f';
          if (array_get($userData, 'ref')) {
              $user = User::where('ref', $userData['ref'])-&gt;firstOrFail();
              $user-&gt;fill($userData);
              $exists = true;
          } else {
              $userData['ref'] = User::generateId();
              $user = new User($userData);
          }
          $user-&gt;source = 'website';
          $user-&gt;optin_platform = 1;
  
          if ($user-&gt;role === 'seeker') {
              $user-&gt;is_active = 1;
              $user-&gt;save();
              $seeker = new UserSeeker([
                  'registration_date' =&gt; Carbon::now(),
                  'available_in'      =&gt; 1,
                  'token'             =&gt; bin2hex(uniqid(rand())),
                  'resume_path'       =&gt; $request-&gt;input('seeker.resume_path'),
                  'resume_date'       =&gt; Carbon::now(),
              ]);
              $seeker = $user-&gt;seeker()-&gt;save($seeker);
              $seeker-&gt;location()-&gt;associate(Address::create($request-&gt;input('location')))-&gt;save();
          } else {
              $user-&gt;is_active = 0;
              $user-&gt;save();
              // $size = $request-&gt;input('company.size', $request-&gt;session()-&gt;get('info'));
              $companyData = $request-&gt;input('company');
              $company = Company::create($companyData);
              $recruiter = $user-&gt;recruiter()-&gt;save(new UserRecruiter([
                  'company_id' =&gt; $company-&gt;id,
              ]));
          }
          DB::commit();
          $this-&gt;json['response'] = ['ref' =&gt; $user-&gt;ref];
          $this-&gt;json['code'] = $this-&gt;code['created'];
          dd($this-&gt;json);
      } catch (MissingParamsException $e) {
          DB::rollback();
          $this-&gt;setError($e, $e-&gt;getMessage(), 'missing');
      } catch (\Exception $e) {
          DB::rollback();
          $this-&gt;setError($e, 'Erreur lors de la création du compte');
      } finally {
          return ($this-&gt;response());
      }
  </code></pre>