title: The given data was invalid. when doing PHPunit testing
body: <p>I'm still new to laravel testing. I want to do testing on my store function. But I keep getting the error Call to The given data was invalid. <a href="https://i.stack.imgur.com/c7Ce1.png" rel="nofollow noreferrer">the error</a>.
  my store function is :</p>
  <pre><code>       public function store(Request $request)
  {
      $request-&gt;validate([
          'companyLogo' =&gt; 'required',
          'companyName' =&gt; 'required',
          'companyDescription' =&gt; 'required',
      ]);
  
      $path = $request-&gt;file('companyLogo')-&gt;store('logo', 's3');
      Storage::disk('s3')-&gt;setVisibility($path, 'public');
  
      $company = Company::create([
          'file_name' =&gt; basename($path),
          'company_field' =&gt; $request-&gt;companyField,
          'logo_url' =&gt; Storage::disk('s3')-&gt;url($path),
          'company_name' =&gt; $request-&gt;companyName,
          'employer_id' =&gt; $request-&gt;employerId,
          'company_address' =&gt; $request-&gt;companyAddress,
          'company_url' =&gt; $request-&gt;companyUrl,
          'email' =&gt; $request-&gt;companyEmail,
          'phone_number' =&gt; $request-&gt;companyPhone,
          'description' =&gt; $request-&gt;companyDescription,
      ]);
  
      $id = $request-&gt;employerId;
      return redirect('/companies' . '/' . $id)-&gt;with('status', 'Company Added Successfully!');
  }
  </code></pre>
  <p>and my test function is</p>
  <pre><code>    public function test_user_register_company()
  {
      $this-&gt;withoutExceptionHandling();
      $user = $this-&gt;candidateRole();
      $this-&gt;actingAs($user);
  
      $response = $this-&gt;post('/companies', [
          'file_name' =&gt; '6eKnVlvM3zEhb8ly4OHedjMPeMplzgrTPi9K9JGt.png',
          'company_field' =&gt; 'Agriculture',
          'logo_url' =&gt; 'LOZ4QYc7Y2mR5gbs6wfJ',
          'company_name' =&gt; 'Company One',
          'employer_id' =&gt; $user-&gt;id,
          'company_address' =&gt; 'Jalan BEmliu9pcjKk4dKkb7Vd',
          'company_url' =&gt; 'imRGdojN0i',
          'email' =&gt; 'www.jN9nJHYZBv0NitDYKOYq.com',
          'phone_number' =&gt; '886797',
          'description' =&gt; 'iEwyNdrfAyFsOTeqv4OCnI3g2jYDEF3CPjqyqYAZ',
      ]);
  
      $this-&gt;assertCount(1, Company::all());
  }
  </code></pre>
  <p>I still confused as to why I got that error.</p>
  <p>the route is <code>Route::post('/companies', [CompaniesController::class, 'store']);</code></p>