Skip to content

Commit

Permalink
Update to Laravel 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Oct 12, 2017
1 parent 173646f commit 4e52601
Show file tree
Hide file tree
Showing 18 changed files with 1,132 additions and 532 deletions.
2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ protected function schedule(Schedule $schedule)
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
25 changes: 10 additions & 15 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ class Handler extends ExceptionHandler
ValidationException::class,
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
Expand All @@ -47,19 +57,4 @@ public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest(route('login'));
}
}
2 changes: 2 additions & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\SiteIndexing;
use App\Http\Middleware\TrustProxies;
use App\Http\Middleware\EncryptCookies;
use App\Http\Middleware\VerifyCsrfToken;
use App\Http\Middleware\RedirectIfBanned;
Expand Down Expand Up @@ -35,6 +36,7 @@ class Kernel extends HttpKernel
ValidatePostSize::class,
TrimStrings::class,
ConvertEmptyStringsToNull::class,
TrustProxies::class,
SiteIndexing::class,
];

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;

class EncryptCookies extends BaseEncrypter
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;

class TrimStrings extends BaseTrimmer
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
Expand Down
29 changes: 29 additions & 0 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;

class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;

/**
* The current proxy header mappings.
*
* @var array
*/
protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];
}
4 changes: 2 additions & 2 deletions app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends BaseVerifier
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
Expand Down
6 changes: 4 additions & 2 deletions artisan
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
Expand All @@ -13,7 +15,7 @@
|
*/

require __DIR__.'/bootstrap/autoload.php';
require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

Expand All @@ -40,7 +42,7 @@ $status = $kernel->handle(
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running. We will fire off the shutdown events
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
Expand Down
17 changes: 0 additions & 17 deletions bootstrap/autoload.php

This file was deleted.

25 changes: 14 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
"php": "^7.1",
"bugsnag/bugsnag-laravel": "^2.4",
"doctrine/dbal": "^2.5",
"laravel/framework": "5.4.*",
"fideloper/proxy": "^3.3",
"laravel/framework": "5.5.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "^1.0",
"laravelcollective/html": "5.4.*",
"laravelcollective/html": "5.5.*",
"lasserafn/php-initial-avatar-generator": "^2.0",
"league/commonmark": "^0.15.2",
"roave/security-advisories": "dev-master",
Expand All @@ -19,14 +20,15 @@
"tijsverkoyen/akismet": "^1.1"
},
"require-dev": {
"filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6",
"jakub-onderka/php-console-highlighter": "^0.3.2",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"laravel/browser-kit-testing": "^1.0",
"laravel/browser-kit-testing": "^2.0",
"laravel/homestead": "^5",
"mockery/mockery": "^0.9.5",
"phpspec/phpspec": "^3.2",
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": "^6.4",
"symfony/css-selector": "^3.1",
"symfony/dom-crawler": "^3.1"
},
Expand All @@ -53,13 +55,9 @@
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
],
"start": [
"composer install",
Expand All @@ -78,5 +76,10 @@
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}
}
Loading

0 comments on commit 4e52601

Please sign in to comment.