Skip to content

Commit f98484e

Browse files
author
Marc Cámara
committed
fixed #173
1 parent 5af9bc3 commit f98484e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["localization", "laravel", "php"],
55
"homepage": "https://github.com/mcamara/laravel-localization",
66
"license": "MIT",
7-
"version": "1.0.4",
7+
"version": "1.0.5",
88
"authors": [
99
{
1010
"name": "Marc Cámara",

src/Mcamara/LaravelLocalization/LaravelLocalization.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
use Illuminate\Http\Request;
1010
use Illuminate\Foundation\Application;
1111
use Illuminate\Support\Facades\URL;
12-
use Session;
13-
use Cookie;
1412

1513

1614
class LaravelLocalization {
@@ -524,9 +522,9 @@ public function getSupportedLanguagesKeys()
524522
*/
525523
protected function getSessionLocale()
526524
{
527-
if ( $this->useSessionLocale() && Session::has($this->cookieSessionName) )
525+
if ( $this->useSessionLocale() && app('session')->has($this->cookieSessionName) )
528526
{
529-
return Session::get($this->cookieSessionName);
527+
return session($this->cookieSessionName);
530528
}
531529

532530
return false;
@@ -540,7 +538,7 @@ protected function storeSession( $locale )
540538
{
541539
if ( $this->useSessionLocale() )
542540
{
543-
Session::put($this->cookieSessionName, $locale);
541+
session($this->cookieSessionName, $locale);
544542
}
545543
}
546544

@@ -804,7 +802,7 @@ public function createUrlFromUri( $uri )
804802
{
805803
if ( empty( $this->baseUrl ) )
806804
{
807-
return URL::to($uri);
805+
return app('url')->to($uri);
808806
}
809807

810808
return $this->baseUrl . ltrim($uri, "/");

0 commit comments

Comments
 (0)