update to laravel 9

This commit is contained in:
xiaomlove
2022-03-31 22:22:04 +08:00
parent 09350c06e2
commit 5f6b3ceb53
30 changed files with 3420 additions and 2517 deletions

View File

@@ -17,11 +17,12 @@ class Platform
*/
public function handle(Request $request, Closure $next)
{
if (empty(nexus()->getPlatform())) {
$platform = nexus()->getPlatform();
if (empty($platform)) {
throw new \InvalidArgumentException("Require platform header.");
}
if (!nexus()->isPlatformValid()) {
throw new \InvalidArgumentException("Invalid platform: " . CURRENT_PLATFORM);
throw new \InvalidArgumentException("Invalid platform: " . $platform);
}
return $next($request);
}

View File

@@ -2,7 +2,7 @@
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@@ -10,7 +10,7 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
* @var array|string|null
* @var array<int, string>|string|null
*/
protected $proxies;
@@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}