Skip to content

Commit

Permalink
Drop old dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed May 17, 2023
1 parent b0ecd4e commit 43eb17b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ See [GitHub releases](https://github.com/mll-lab/laravel-graphiql/releases).

## Unreleased

## v3.0.0

### Removed

- Drop support for Laravel versions older than 9
- Drop support for PHP versions older than 8

## v2.0.3

### Fixed
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
}
],
"require": {
"php": "^7.1 || ^8",
"illuminate/console": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10",
"illuminate/contracts": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10",
"illuminate/support": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10"
"php": "^8",
"illuminate/console": "^9 || ^10",
"illuminate/contracts": "^9 || ^10",
"illuminate/support": "^9 || ^10"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.29",
"laravel/lumen-framework": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8 || ^9 || ^10",
"mll-lab/php-cs-fixer-config": "^4.4",
"nunomaduro/larastan": "^2.4.1",
"orchestra/testbench": "^4 || ^5 || ^6 || ^7.7 || ^8.8",
"laravel/lumen-framework": "^9 || ^10",
"mll-lab/php-cs-fixer-config": "^5",
"nunomaduro/larastan": "^2.5.2",
"orchestra/testbench": "^7.7 || ^8.8",
"phpstan/extension-installer": "^1",
"phpstan/phpstan": "^1.10.3",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-phpunit": "^1.1.1"
"phpstan/phpstan": "^1.10.15",
"phpstan/phpstan-mockery": "^1.1.1",
"phpstan/phpstan-phpunit": "^1.3.11"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
21 changes: 6 additions & 15 deletions src/GraphiQLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,18 @@

class GraphiQLController
{
/** @var \Illuminate\Contracts\Routing\UrlGenerator */
protected $urlGenerator;

/** @var \Illuminate\Contracts\View\Factory $ */
protected $viewFactory;

public function __construct(UrlGenerator $urlGenerator, ViewFactory $viewFactory)
{
$this->urlGenerator = $urlGenerator;
$this->viewFactory = $viewFactory;
}
public function __construct(
protected UrlGenerator $urlGenerator,
protected ViewFactory $viewFactory,
) {}

public function __invoke(ConfigRepository $config, Request $request): View
{
// Handle /, /graphiql or graphiql
$path = '/' . trim($request->path(), '/');

$routeConfig = $config->get("graphiql.routes.{$path}");
if (null === $routeConfig) {
throw new NotFoundHttpException("No graphiql route config found for '{$path}'.");
}
$routeConfig = $config->get("graphiql.routes.{$path}")
?? throw new NotFoundHttpException("No graphiql route config found for '{$path}'.");
assert(is_array($routeConfig));

return $this->viewFactory->make('graphiql::index', [
Expand Down

0 comments on commit 43eb17b

Please sign in to comment.