mirror of
https://gh.wpcy.net/https://github.com/aspirepress/AspireCloud.git
synced 2026-07-17 11:37:03 +08:00
* fix: use getenv() in UserSeeder, env() is broken there * feat: rewrite download/version/screenshot/banner urls in plugins/themes * feat: add AssetType::THEME_SCREENSHOT * feat: add handy RouteTestCommand * feat: rewrite icon urls
28 lines
786 B
PHP
28 lines
786 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
|
|
class RouteTestCommand extends Command
|
|
{
|
|
protected $signature = 'route:test {uri}';
|
|
protected $description = 'Match path against routes';
|
|
|
|
public function handle(): int
|
|
{
|
|
$uri = $this->argument('uri');
|
|
$router = Route::getRoutes();
|
|
$request = Request::create($uri);
|
|
try {
|
|
$route = $router->match($request);
|
|
$this->info("MATCH: {$route->uri} [{$route->getName()}]");
|
|
} catch (NotFoundHttpException) {
|
|
$this->fail("Route not found for $uri");
|
|
}
|
|
return 0;
|
|
}
|
|
}
|