Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #522 from edricwilliem/master
Browse files Browse the repository at this point in the history
convert request to lumen request on lumen application
  • Loading branch information
Arkanius committed Apr 1, 2022
2 parents b9b766a + 1105f31 commit 711d7f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Server/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use SwooleTW\Http\Concerns\InteractsWithSwooleQueue;
use SwooleTW\Http\Concerns\InteractsWithSwooleTable;
use Symfony\Component\ErrorHandler\Error\FatalError;
use Laravel\Lumen\Http\Request as LumenRequest;

/**
* Class Manager
Expand Down Expand Up @@ -215,6 +216,10 @@ public function onRequest($swooleRequest, $swooleResponse)
// transform swoole request to illuminate request
$illuminateRequest = Request::make($swooleRequest)->toIlluminate();

if (!$sandbox->isLaravel()) { // is lumen app
$illuminateRequest = LumenRequest::createFromBase($illuminateRequest);
}

// set current request to sandbox
$sandbox->setRequest($illuminateRequest);

Expand Down

0 comments on commit 711d7f6

Please sign in to comment.