Skip to content

Commit

Permalink
Laravel 5.2 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
bestmomo committed Dec 23, 2015
1 parent 03a9aee commit 2f13704
Show file tree
Hide file tree
Showing 23 changed files with 189 additions and 133 deletions.
6 changes: 0 additions & 6 deletions .bowerrc

This file was deleted.

10 changes: 8 additions & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler {

Expand All @@ -12,7 +15,10 @@ class Handler extends ExceptionHandler {
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];

/**
Expand Down
Empty file removed app/Handlers/Events/.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions app/Http/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
public function indexFront()
{
$posts = $this->blog_gestion->indexFront($this->nbrPages);
$links = $posts->setPath('')->render();
$links = $posts->render();

return view('front.blog.index', compact('posts', 'links'));
}
Expand Down Expand Up @@ -254,7 +254,7 @@ public function tag(Request $request)
{
$tag = $request->input('tag');
$posts = $this->blog_gestion->indexTag($this->nbrPages, $tag);
$links = $posts->setPath('')->appends(compact('tag'))->render();
$links = $posts->appends(compact('tag'))->render();
$info = trans('front/blog.info-tag') . '<strong>' . $this->blog_gestion->getTagById($tag) . '</strong>';

return view('front.blog.index', compact('posts', 'links', 'info'));
Expand All @@ -270,7 +270,7 @@ public function search(SearchRequest $request)
{
$search = $request->input('search');
$posts = $this->blog_gestion->search($this->nbrPages, $search);
$links = $posts->setPath('')->appends(compact('search'))->render();
$links = $posts->appends(compact('search'))->render();
$info = trans('front/blog.info-search') . '<strong>' . $search . '</strong>';

return view('front.blog.index', compact('posts', 'links', 'info'));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
public function index()
{
$comments = $this->comment_gestion->index(4);
$links = $comments->setPath('')->render();
$links = $comments->render();

return view('back.comments.index', compact('comments', 'links'));
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function indexSort($role)
{
$counts = $this->user_gestion->counts();
$users = $this->user_gestion->index(4, $role);
$links = $users->setPath('')->render();
$links = $users->render();
$roles = $this->role_gestion->all();

return view('back.users.index', compact('users', 'links', 'counts', 'roles'));
Expand Down Expand Up @@ -124,7 +124,7 @@ public function edit(User $user)
*/
public function update(
UserUpdateRequest $request,
$user)
User $user)
{
$this->user_gestion->update($request->all(), $user);

Expand All @@ -140,7 +140,7 @@ public function update(
*/
public function updateSeen(
Request $request,
$user)
User $user)
{
$this->user_gestion->update($request->all(), $user);

Expand Down
22 changes: 17 additions & 5 deletions app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,20 @@

Route::resource('user', 'UserController');

// Auth
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
// Authentication routes...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
Route::get('auth/confirm/{token}', 'Auth\AuthController@getConfirm');

// Registration routes...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');

// Password reset link request routes...
Route::get('password/email', 'Auth\PasswordController@getEmail');
Route::post('password/email', 'Auth\PasswordController@postEmail');

// Password reset routes...
Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
Route::post('password/reset', 'Auth\PasswordController@postReset');
3 changes: 1 addition & 2 deletions app/Jobs/ChangeLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace App\Jobs;

use App\Jobs\Job;
use Illuminate\Contracts\Bus\SelfHandling;

class ChangeLocale extends Job implements SelfHandling
class ChangeLocale extends Job
{
public $lang;

Expand Down
3 changes: 1 addition & 2 deletions app/Jobs/SendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
use App\Jobs\Job;
use App\Models\User;
use Request;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Mail\Mailer;

class SendMail extends Job implements SelfHandling
class SendMail extends Job
{

/**
Expand Down
3 changes: 1 addition & 2 deletions app/Jobs/SetLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

use App\Jobs\Job;
use Request;
use Illuminate\Contracts\Bus\SelfHandling;

class SetLocale extends Job implements SelfHandling
class SetLocale extends Job
{
/**
* Execute the command.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class EventServiceProvider extends ServiceProvider {
* @var array
*/
protected $listen = [
'auth.login' => ['App\Services\Statut@setLoginStatut'],
'auth.logout' => ['App\Services\Statut@setVisitorStatut'],
'Illuminate\Auth\Events\Login' => ['App\Services\Statut@setLoginStatut'],
'Illuminate\Auth\Events\Logout' => ['App\Services\Statut@setVisitorStatut'],
'user.access' => ['App\Services\Statut@setStatut']
];

Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/RoleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function update($inputs)
*/
public function getAllSelect()
{
$select = $this->all()->lists('title', 'id');
$select = $this->all()->pluck('title', 'id');

return compact('select');
}
Expand Down
9 changes: 4 additions & 5 deletions app/Services/Html/HtmlServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ class HtmlServiceProvider extends \Collective\Html\HtmlServiceProvider {
*/
protected function registerFormBuilder()
{
$this->app->bindShared('form', function($app)
{
$form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());
$this->app->singleton('form', function ($app) {
$form = new FormBuilder($app['html'], $app['url'], $app['view'], $app['session.store']->getToken());

return $form->setSessionStore($app['session.store']);
});
return $form->setSessionStore($app['session.store']);
});
}

}
6 changes: 3 additions & 3 deletions app/Services/Statut.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class Statut {
/**
* Set the login user statut
*
* @param App\Models\User $user
* @param Illuminate\Auth\Events\Login $login
* @return void
*/
public function setLoginStatut($user)
public function setLoginStatut($login)
{
session()->put('statut', $user->role->slug);
session()->put('statut', $login->user->role->slug);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions artisan
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ $app = require_once __DIR__.'/bootstrap/app.php';
|
*/

$kernel = $app->make('Illuminate\Contracts\Console\Kernel');
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);

/*
Expand Down
6 changes: 0 additions & 6 deletions bower.json

This file was deleted.

29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"laravelcollective/html": "5.1.*",
"bestmomo/filemanager": "1.1.*"
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*-dev",
"bestmomo/filemanager": "1.1.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
Expand All @@ -33,25 +34,25 @@
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"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
}
}

15 changes: 13 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

return [

/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your application utilizes. Set this in your ".env" file.
|
*/

'env' => env('APP_ENV', 'production'),

/*
|--------------------------------------------------------------------------
| Application Debug Mode
Expand Down Expand Up @@ -126,13 +139,11 @@
/*
* Laravel Framework Service Providers...
*/
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Routing\ControllerServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Expand Down
Loading

0 comments on commit 2f13704

Please sign in to comment.