Skip to content

Commit

Permalink
V5.1 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
bestmomo committed Jun 9, 2015
1 parent 0a8a7f8 commit 34713a4
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 118 deletions.
19 changes: 0 additions & 19 deletions app/Commands/ChangeLocaleCommand.php

This file was deleted.

7 changes: 0 additions & 7 deletions app/Commands/Command.php

This file was deleted.

31 changes: 0 additions & 31 deletions app/Commands/SetLocaleCommand.php

This file was deleted.

12 changes: 0 additions & 12 deletions app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

use Illuminate\Contracts\Auth\Guard;
use Illuminate\Events\Dispatcher;
use App\Http\Requests\Auth\LoginRequest;
use App\Http\Requests\Auth\RegisterRequest;
use App\Repositories\UserRepository;
use App\Services\MaxValueDelay;

class AuthController extends Controller {

/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/

use AuthenticatesAndRegistersUsers;

/**
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/PasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function postReset(ResetPasswordRequest $request)
$user->password = bcrypt($password);

$user->save();

$this->auth->login($user);
});

switch ($response)
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace App\Http\Controllers;

use App\Commands\ChangeLocaleCommand;
use App\Jobs\ChangeLocaleCommand;

class HomeController extends Controller {

Expand All @@ -17,7 +17,7 @@ public function index()
/**
* Change language.
*
* @param Illuminate\Session\SessionManager $session
* @param App\Jobs\ChangeLocaleCommand $changeLocaleCommand
* @return Response
*/
public function language(
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Closure;

use App\Commands\SetLocaleCommand;
use App\Jobs\SetLocaleCommand;

use Illuminate\Bus\Dispatcher as BusDispatcher;

Expand All @@ -26,7 +26,7 @@ class App {
* Create a new App instance.
*
* @param Illuminate\Bus\Dispatcher $bus
* @param App\Commands\SetLocaleCommand $setLocaleCommand
* @param App\Jobs\SetLocaleCommand $setLocaleCommand
* @return void
*/
public function __construct(
Expand Down
17 changes: 17 additions & 0 deletions app/Jobs/ChangeLocaleCommand.php
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');
}
}
21 changes: 21 additions & 0 deletions app/Jobs/Job.php
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;
}
30 changes: 30 additions & 0 deletions app/Jobs/SetLocaleCommand.php
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'));
}
}
2 changes: 1 addition & 1 deletion bootstrap/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
|
*/

$compiledPath = __DIR__.'/../vendor/compiled.php';
$compiledPath = __DIR__.'/cache/compiled.php';

if (file_exists($compiledPath))
{
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
94 changes: 51 additions & 43 deletions composer.json
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
}

2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

'key' => env('APP_KEY', 'YourSecretKey!!!'),

'cipher' => MCRYPT_RIJNDAEL_128,
'cipher' => 'AES-128-CBC',

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 34713a4

Please sign in to comment.