Update Laravel to v6

This commit is contained in:
Jonny Barnes 2019-10-19 15:34:49 +01:00
parent 6d2b4d55ee
commit ec01b3c6a2
24 changed files with 515 additions and 545 deletions

View file

@ -37,8 +37,9 @@ class Handler extends ExceptionHandler
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param \Exception $exception * @param \Exception $exception
* @return void * @return void
* @throws Exception
*/ */
public function report(Exception $exception) public function report(Exception $exception)
{ {
@ -56,7 +57,7 @@ class Handler extends ExceptionHandler
'fallback' => 'There was an exception.', 'fallback' => 'There was an exception.',
'pretext' => 'There was an exception.', 'pretext' => 'There was an exception.',
'color' => '#d00000', 'color' => '#d00000',
'author_name' => App::environment(), 'author_name' => app()->environment(),
'author_link' => config('app.url'), 'author_link' => config('app.url'),
'fields' => [[ 'fields' => [[
'title' => get_class($exception) ?? 'Unkown Exception', 'title' => get_class($exception) ?? 'Unkown Exception',

View file

@ -2,10 +2,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController class Controller extends BaseController
{ {

View file

@ -14,11 +14,11 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected $middleware = [ protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class, \App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class, \App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
]; ];
/** /**

View file

@ -2,22 +2,22 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware; use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware class TrustProxies extends Middleware
{ {
/** /**
* The trusted proxies for this application. * The trusted proxies for this application.
* *
* @var array * @var array|string
*/ */
protected $proxies; protected $proxies;
/** /**
* The header that should be used to detect proxies. * The header that should be used to detect proxies.
* *
* @var string * @var int
*/ */
protected $headers = Request::HEADER_X_FORWARDED_ALL; protected $headers = Request::HEADER_X_FORWARDED_ALL;
} }

View file

@ -3,6 +3,7 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider class AuthServiceProvider extends ServiceProvider
{ {

View file

@ -2,8 +2,8 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore

View file

@ -2,8 +2,10 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Support\Facades\Event; use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider class EventServiceProvider extends ServiceProvider
{ {
@ -13,8 +15,8 @@ class EventServiceProvider extends ServiceProvider
* @var array * @var array
*/ */
protected $listen = [ protected $listen = [
'App\Events\Event' => [ Registered::class => [
'App\Listeners\EventListener', SendEmailVerificationNotification::class,
], ],
]; ];

View file

@ -2,8 +2,8 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {

View file

@ -10,7 +10,8 @@
"license": "CC0-1.0", "license": "CC0-1.0",
"require": { "require": {
"php": ">=7.2.0", "php": ">=7.2.0",
"cviebrock/eloquent-sluggable": "~4.3", "ext-json": "*",
"cviebrock/eloquent-sluggable": "~6.0",
"fideloper/proxy": "~4.0", "fideloper/proxy": "~4.0",
"guzzlehttp/guzzle": "~6.0", "guzzlehttp/guzzle": "~6.0",
"indieauth/client": "~0.1", "indieauth/client": "~0.1",
@ -18,7 +19,7 @@
"jonnybarnes/emoji-a11y": "^0.3", "jonnybarnes/emoji-a11y": "^0.3",
"jonnybarnes/indieweb": "dev-master", "jonnybarnes/indieweb": "dev-master",
"jonnybarnes/webmentions-parser": "0.4.*", "jonnybarnes/webmentions-parser": "0.4.*",
"laravel/framework": "5.8.*", "laravel/framework": "^6.0",
"laravel/horizon": "^3.0", "laravel/horizon": "^3.0",
"laravel/scout": "^7.0", "laravel/scout": "^7.0",
"laravel/telescope": "^2.0", "laravel/telescope": "^2.0",
@ -28,15 +29,14 @@
"league/commonmark-ext-autolink": "^1.0", "league/commonmark-ext-autolink": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0", "league/flysystem-aws-s3-v3": "^1.0",
"mf2/mf2": "~0.3", "mf2/mf2": "~0.3",
"phaza/laravel-postgis": "~3.1", "phaza/laravel-postgis": "~4.0",
"pmatseykanets/laravel-scout-postgres": "~5.0", "pmatseykanets/laravel-scout-postgres": "~6.0",
"predis/predis": "~1.0", "predis/predis": "~1.0",
"ramsey/uuid": "^3.5", "ramsey/uuid": "^3.5",
"sensiolabs/security-checker": "^6.0", "sensiolabs/security-checker": "^6.0",
"spatie/browsershot": "~3.0", "spatie/browsershot": "~3.0",
"spatie/commonmark-highlighter": "^2.0", "spatie/commonmark-highlighter": "^2.0",
"tgalopin/html-sanitizer": "^1.1", "tgalopin/html-sanitizer": "^1.1"
"thujohn/twitter": "~2.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "~3.0", "barryvdh/laravel-debugbar": "~3.0",

892
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@ return [
| |
*/ */
'name' => 'jonnybarnes.uk', 'name' => env('APP_NAME', 'Laravel'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -100,7 +100,7 @@ return [
| |
*/ */
'timezone' => env('APP_TIMEZONE', 'UTC'), 'timezone' => 'UTC',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -113,7 +113,7 @@ return [
| |
*/ */
'locale' => env('APP_LANG', 'en'), 'locale' => 'en',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -202,14 +202,9 @@ return [
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class, // App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\TelescopeServiceProvider::class,
App\Providers\HorizonServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
App\Providers\HorizonServiceProvider::class,
/* App\Providers\TelescopeServiceProvider::class,
* Thujohns Twitter API client
*/
Thujohn\Twitter\TwitterServiceProvider::class,
], ],
@ -261,8 +256,6 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Twitter' => Thujohn\Twitter\Facades\Twitter::class,
], ],
'piwik' => env('PIWIK', false), 'piwik' => env('PIWIK', false),

View file

@ -36,7 +36,8 @@ return [
'secret' => env('PUSHER_APP_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
// 'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
], ],
], ],

View file

@ -13,7 +13,8 @@ return [
| using this caching library. This connection is used when another is | using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function. | not explicitly specified when executing a given caching function.
| |
| Supported: "apc", "array", "database", "file", "memcached", "redis" | Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
| |
*/ */
@ -75,6 +76,15 @@ return [
'connection' => 'default', 'connection' => 'default',
], ],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
], ],
/* /*
@ -88,6 +98,6 @@ return [
| |
*/ */
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
]; ];

View file

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Str;
return [ return [
/* /*
@ -35,6 +37,7 @@ return [
'sqlite' => [ 'sqlite' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')), 'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '', 'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
@ -42,6 +45,7 @@ return [
'mysql' => [ 'mysql' => [
'driver' => 'mysql', 'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'), 'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'forge'),
@ -61,6 +65,7 @@ return [
'pgsql' => [ 'pgsql' => [
'driver' => 'pgsql', 'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '5432'), 'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'forge'),
@ -75,6 +80,7 @@ return [
'sqlsrv' => [ 'sqlsrv' => [
'driver' => 'sqlsrv', 'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'), 'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'forge'),
@ -124,9 +130,15 @@ return [
'redis' => [ 'redis' => [
'client' => 'predis', 'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
],
'default' => [ 'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', 6379),
@ -134,6 +146,7 @@ return [
], ],
'cache' => [ 'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', 6379),

View file

@ -51,7 +51,7 @@ return [
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage', 'url' => env('APP_URL') . '/storage',
'visibility' => 'public', 'visibility' => 'public',
], ],

View file

@ -11,10 +11,39 @@ return [
| passwords for your application. By default, the bcrypt algorithm is | passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish. | used; however, you remain free to modify this option if you wish.
| |
| Supported: "bcrypt", "argon" | Supported: "bcrypt", "argon", "argon2id"
| |
*/ */
'driver' => 'bcrypt', 'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
]; ];

View file

@ -1,5 +1,6 @@
<?php <?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler; use Monolog\Handler\SyslogUdpHandler;
@ -37,6 +38,7 @@ return [
'stack' => [ 'stack' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => ['daily'], 'channels' => ['daily'],
'ignore_exceptions' => false,
], ],
'single' => [ 'single' => [
@ -88,6 +90,11 @@ return [
'driver' => 'errorlog', 'driver' => 'errorlog',
'level' => 'debug', 'level' => 'debug',
], ],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
], ],
]; ];

View file

@ -11,8 +11,8 @@ return [
| sending of e-mail. You may specify which one you're using throughout | sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail. | your application here. By default, Laravel is setup for SMTP mail.
| |
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses" | Supported: "smtp", "sendmail", "mailgun", "ses"
| "sparkpost", "log", "array" | "postmark", "log", "array"
| |
*/ */

View file

@ -46,6 +46,7 @@ return [
'host' => 'localhost', 'host' => 'localhost',
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'block_for' => 0,
], ],
'sqs' => [ 'sqs' => [
@ -79,6 +80,7 @@ return [
*/ */
'failed' => [ 'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'), 'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs', 'table' => 'failed_jobs',
], ],

View file

@ -20,24 +20,14 @@ return [
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
], ],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [ 'ses' => [
'key' => env('SES_KEY'), 'key' => env('SES_KEY'),
'secret' => env('SES_SECRET'), 'secret' => env('SES_SECRET'),
'region' => 'us-east-1', 'region' => 'us-east-1',
], ],
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
],
]; ];

View file

@ -14,7 +14,7 @@ return [
| you may specify any of the other wonderful drivers provided here. | you may specify any of the other wonderful drivers provided here.
| |
| Supported: "file", "cookie", "database", "apc", | Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array" | "memcached", "redis", "dynamodb", "array"
| |
*/ */
@ -31,7 +31,7 @@ return [
| |
*/ */
'lifetime' => 60 * 24 * 7, 'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false, 'expire_on_close' => false,
@ -126,7 +126,7 @@ return [
'cookie' => env( 'cookie' => env(
'SESSION_COOKIE', 'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session' Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
), ),
/* /*

View file

@ -13,7 +13,6 @@ return [
| |
*/ */
'password' => 'Passwords must be at least six characters and match the confirmation.',
'reset' => 'Your password has been reset!', 'reset' => 'Your password has been reset!',
'sent' => 'We have e-mailed your password reset link!', 'sent' => 'We have e-mailed your password reset link!',
'token' => 'This password reset token is invalid.', 'token' => 'This password reset token is invalid.',

View file

@ -40,6 +40,7 @@ return [
'dimensions' => 'The :attribute has invalid image dimensions.', 'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.', 'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.', 'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values',
'exists' => 'The selected :attribute is invalid.', 'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.', 'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.', 'filled' => 'The :attribute field must have a value.',
@ -92,6 +93,7 @@ return [
'not_in' => 'The selected :attribute is invalid.', 'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.', 'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.', 'numeric' => 'The :attribute must be a number.',
'password' => 'The password is incorrect.',
'present' => 'The :attribute field must be present.', 'present' => 'The :attribute field must be present.',
'regex' => 'The :attribute format is invalid.', 'regex' => 'The :attribute format is invalid.',
'required' => 'The :attribute field is required.', 'required' => 'The :attribute field is required.',

View file

@ -11,6 +11,8 @@
| |
*/ */
use Illuminate\Support\Facades\Route;
Route::group(['domain' => config('url.longurl')], function () { Route::group(['domain' => config('url.longurl')], function () {
Route::get('/', 'FrontPageController@index'); Route::get('/', 'FrontPageController@index');