Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84 code example

Example: array_merge() does not accept unknown named parameters laravel

public function test_fields_are_required()
   {
    collect(value: ['name','org_number','company','SSN','ZIP_Code','residence','description'])
    ->each(callback: function($field){
        $response = $this->post('/api/customer',
             array_merge( $this->data(), [$field => ''])); 

    //$this->assertCount(expectedCount: 1, haystack: $customer);
    
        $response->assertSessionHasErrors($field);
        $this->assertCount(expectedCount: 0, haystack: Customer::all());
    });
   }

Tags:

Php Example