-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
129 additions
and
118 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php namespace App\Jobs; | ||
|
||
use App\Jobs\Job; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
|
||
class ChangeLocaleCommand extends Job implements SelfHandling | ||
{ | ||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
session()->set('locale', session('locale') == 'fr' ? 'en' : 'fr'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
use Illuminate\Bus\Queueable; | ||
|
||
abstract class Job | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Queueable Jobs | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This job base class provides a central location to place any logic that | ||
| is shared across all of your jobs. The trait included with the class | ||
| provides access to the "queueOn" and "delay" queue helper methods. | ||
| | ||
*/ | ||
|
||
use Queueable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php namespace App\Jobs; | ||
|
||
use App\Jobs\Job; | ||
use Request; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
|
||
class SetLocaleCommand extends Job implements SelfHandling | ||
{ | ||
/** | ||
* The availables languages. | ||
* | ||
* @array $languages | ||
*/ | ||
protected $languages = ['en','fr']; | ||
|
||
/** | ||
* Execute the command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
if(!session()->has('locale')) | ||
{ | ||
session()->put('locale', Request::getPreferredLanguage($this->languages)); | ||
} | ||
|
||
app()->setLocale(session('locale')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,53 @@ | ||
{ | ||
"name": "laravel/laravel", | ||
"description": "The Laravel Framework.", | ||
"keywords": ["framework", "laravel"], | ||
"license": "MIT", | ||
"type": "project", | ||
"require": { | ||
"laravel/framework": "5.0.*", | ||
"laravelcollective/html": "5.0.*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.0", | ||
"phpspec/phpspec": "~2.1" | ||
}, | ||
"autoload": { | ||
"classmap": [ | ||
"database" | ||
], | ||
"psr-4": { | ||
"App\\": "app/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"classmap": [ | ||
"tests/TestCase.php" | ||
] | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"php artisan clear-compiled", | ||
"php artisan optimize" | ||
], | ||
"post-update-cmd": [ | ||
"php artisan clear-compiled", | ||
"php artisan optimize" | ||
], | ||
"post-create-project-cmd": [ | ||
"php -r \"copy('.env.example', '.env');\"", | ||
"php artisan key:generate" | ||
] | ||
}, | ||
"config": { | ||
"preferred-install": "dist" | ||
} | ||
"name": "laravel/laravel", | ||
"description": "The Laravel Framework.", | ||
"keywords": ["framework", "laravel"], | ||
"license": "MIT", | ||
"type": "project", | ||
"require": { | ||
"php": ">=5.5.9", | ||
"laravel/framework": "5.1.*", | ||
"laravelcollective/html": "5.0.*" | ||
}, | ||
"require-dev": { | ||
"fzaninotto/faker": "~1.4", | ||
"mockery/mockery": "0.9.*", | ||
"phpunit/phpunit": "~4.0", | ||
"phpspec/phpspec": "~2.1" | ||
}, | ||
"autoload": { | ||
"classmap": [ | ||
"database" | ||
], | ||
"psr-4": { | ||
"App\\": "app/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"classmap": [ | ||
"tests/TestCase.php" | ||
] | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"php artisan clear-compiled", | ||
"php artisan optimize" | ||
], | ||
"post-update-cmd": [ | ||
"php artisan clear-compiled", | ||
"php artisan optimize" | ||
], | ||
"post-root-package-install": [ | ||
"php -r \"copy('.env.example', '.env');\"" | ||
], | ||
"post-create-project-cmd": [ | ||
"php artisan key:generate" | ||
] | ||
}, | ||
"config": { | ||
"preferred-install": "dist" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters