Skip to content

Commit 16f19ce

Browse files
authored
Fix Lumen compatibility (#23)
1 parent 43eb17b commit 16f19ce

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ See [GitHub releases](https://github.com/mll-lab/laravel-graphiql/releases).
99

1010
## Unreleased
1111

12+
## v3.0.1
13+
14+
### Fixed
15+
16+
- Fix Lumen compatibility
17+
1218
## v3.0.0
1319

1420
### Removed

src/DownloadAssetsCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function downloadFileFromCDN(string $localPath, string $cdnPath): void
5353
}
5454

5555
$contents = file_get_contents("https:{$cdnPath}");
56-
if (false === $contents) {
56+
if ($contents === false) {
5757
$error = error_get_last();
5858
throw new \ErrorException($error['message'] ?? 'An error occurred', 0, $error['type'] ?? 1);
5959
}

src/GraphiQLController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace MLL\GraphiQL;
44

55
use Illuminate\Config\Repository as ConfigRepository;
6-
use Illuminate\Contracts\Routing\UrlGenerator;
76
use Illuminate\Contracts\View\Factory as ViewFactory;
87
use Illuminate\Contracts\View\View;
98
use Illuminate\Http\Request;
@@ -12,7 +11,6 @@
1211
class GraphiQLController
1312
{
1413
public function __construct(
15-
protected UrlGenerator $urlGenerator,
1614
protected ViewFactory $viewFactory,
1715
) {}
1816

@@ -34,7 +32,7 @@ public function __invoke(ConfigRepository $config, Request $request): View
3432
protected function maybeURL(?string $endpoint): ?string
3533
{
3634
return is_string($endpoint) && filter_var($endpoint, FILTER_VALIDATE_URL)
37-
? $this->urlGenerator->to($endpoint)
35+
? url($endpoint) // Avoid injecting UrlGenerator for Lumen compatibility
3836
: $endpoint;
3937
}
4038
}

0 commit comments

Comments
 (0)