apiRoutesContainingAny(['admin', 'users', 'finance', 'settings', 'school-years', 'inventory']); foreach (array_slice($routes, 0, 70) as $route) { $method = $this->primaryMethod($route); $uri = $route->uri(); $this->actingAs($this->parent, 'web'); $response = $this->json($method, $this->materializePath($uri), $this->payloadFor($method, $uri), [ 'Accept' => 'application/json', 'X-Requested-With' => 'XMLHttpRequest', ]); $this->assertControlled($response, $method, $uri); $this->assertNotEquals(500, $response->getStatusCode(), $method.' '.$uri.' crashed under web guard identity.'); } } }