From f98484eda4893bdc2803c60ef656beecc422a903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20C=C3=A1mara?= Date: Thu, 12 Feb 2015 15:07:45 +0000 Subject: [PATCH] fixed #173 --- composer.json | 2 +- .../LaravelLocalization/LaravelLocalization.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 32fea8b..1ebab50 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["localization", "laravel", "php"], "homepage": "https://github.com/mcamara/laravel-localization", "license": "MIT", - "version": "1.0.4", + "version": "1.0.5", "authors": [ { "name": "Marc Cámara", diff --git a/src/Mcamara/LaravelLocalization/LaravelLocalization.php b/src/Mcamara/LaravelLocalization/LaravelLocalization.php index 1255231..59a2491 100644 --- a/src/Mcamara/LaravelLocalization/LaravelLocalization.php +++ b/src/Mcamara/LaravelLocalization/LaravelLocalization.php @@ -9,8 +9,6 @@ use Illuminate\Http\Request; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\URL; -use Session; -use Cookie; class LaravelLocalization { @@ -524,9 +522,9 @@ public function getSupportedLanguagesKeys() */ protected function getSessionLocale() { - if ( $this->useSessionLocale() && Session::has($this->cookieSessionName) ) + if ( $this->useSessionLocale() && app('session')->has($this->cookieSessionName) ) { - return Session::get($this->cookieSessionName); + return session($this->cookieSessionName); } return false; @@ -540,7 +538,7 @@ protected function storeSession( $locale ) { if ( $this->useSessionLocale() ) { - Session::put($this->cookieSessionName, $locale); + session($this->cookieSessionName, $locale); } } @@ -804,7 +802,7 @@ public function createUrlFromUri( $uri ) { if ( empty( $this->baseUrl ) ) { - return URL::to($uri); + return app('url')->to($uri); } return $this->baseUrl . ltrim($uri, "/");