Skip to content

Commit c84f168

Browse files
authored
replace usage of $this->content for $content to prevent type mismatch (#48)
* replace usage of $this->content for $content to prevent type mismatch * Fix setLaravelSession with SessionDecorator * fix dependencies versions. fix minor style
1 parent 86d47ce commit c84f168

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"mockery/mockery": "~1.0",
3434
"phpunit/phpunit": "^9.0|^10.0",
3535
"squizlabs/php_codesniffer": "~2.0",
36-
"php-open-source-saver/jwt-auth": "^1.4"
36+
"php-open-source-saver/jwt-auth": "^1.4 | ^2.2"
3737
},
3838
"suggest": {
3939
"php-open-source-saver/jwt-auth": "Protect your API with JSON Web Tokens."

src/Http/Request.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Dingo\Api\Http\Parser\Accept;
66
use Illuminate\Http\Request as IlluminateRequest;
77
use Dingo\Api\Contract\Http\Request as RequestInterface;
8+
use Illuminate\Session\SymfonySessionDecorator;
89
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
910

1011
class Request extends IlluminateRequest implements RequestInterface
@@ -37,8 +38,9 @@ public function createFromIlluminate(IlluminateRequest $old)
3738
);
3839

3940
try {
40-
if ($session = $old->getSession()) {
41-
$new->setLaravelSession($old->getSession());
41+
$session = $old->getSession();
42+
if ($session instanceof SymfonySessionDecorator) {
43+
$new->setLaravelSession($session->store);
4244
}
4345
} catch (SessionNotFoundException $exception) {
4446
}

0 commit comments

Comments
 (0)