👁 查看:LicenseCheck.php
路径:/home/boguraj1/.trash/app/Http/Middleware/LicenseCheck.php
大小:490 B · 修改:2026-07-23 16:13:46 · 权限:0644 · 可写
<?php

namespace App\Http\Middleware;

use App\Services\LicenseService;
use Closure;
use Illuminate\Http\Request;

class LicenseCheck
{
    public function __construct(private LicenseService $license) {}

    public function handle(Request $request, Closure $next)
    {
        if (!$this->license->isValid()) {
            return response()->view('errors.license', [
                'domain' => $request->getHost(),
            ], 403);
        }

        return $next($request);
    }
}