create(['kvk_number' => '12345678']); $this->assertSame('12345678', $company->fresh()->kvk_number); } public function test_kvk_number_is_nullable(): void { $company = Company::factory()->create(['kvk_number' => null]); $this->assertNull($company->fresh()->kvk_number); } public function test_kvk_number_is_indexed(): void { $row = DB::selectOne( 'SELECT INDEX_NAME FROM information_schema.STATISTICS ' ."WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'companies' AND COLUMN_NAME = 'kvk_number'" ); $this->assertNotNull($row, 'Expected index on companies.kvk_number'); } }