From 7e8c3cba6df113f5e462d42f6f645c228f97264e Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 2 Nov 2018 18:11:14 -0400 Subject: [PATCH] Manually pull in laravel 5.7 updates that don't merge cleanly --- .gitignore | 6 +++-- .laravel-commit | 2 +- app/Http/Kernel.php | 22 ++++++++++++++++-- app/User.php | 1 + composer.json | 23 ++++++++++--------- config/app.php | 16 ++++++++++++- config/cache.php | 9 ++++---- config/session.php | 8 ++++--- .../2014_10_12_000000_create_users_table.php | 1 + readme.md | 2 +- 10 files changed, 64 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index f9336ab..8de3019 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ .DS_Store +.phpunit.result.cache /.env /.idea /.vagrant /.vscode -/npm-debug.log -/yarn-error.log +/nbproject /bower_components /node_modules /public/css @@ -16,3 +16,5 @@ /storage/*.key /storage/exports /vendor +/npm-debug.log +/yarn-error.log diff --git a/.laravel-commit b/.laravel-commit index 2a78f06..d049bb3 100644 --- a/.laravel-commit +++ b/.laravel-commit @@ -1 +1 @@ -ff2f828c55ae9cf1cc3b0d75aa255759b63bf947 +5d7936eeb079ed8b403da422eb24783cdb9732fc diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8278fd2..3e5d1e3 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,7 +14,7 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ - \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, + \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, @@ -51,12 +51,30 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + ]; + + /** + * The priority-sorted list of middleware. + * + * This forces the listed middleware to always be in the given order. + * + * @var array + */ + protected $middlewarePriority = [ + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \App\Http\Middleware\Authenticate::class, + \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Illuminate\Auth\Middleware\Authorize::class, ]; } diff --git a/app/User.php b/app/User.php index 08995e5..3fddfa8 100644 --- a/app/User.php +++ b/app/User.php @@ -3,6 +3,7 @@ namespace App; use Illuminate\Notifications\Notifiable; +use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; use Hash; use App\Traits\Timestamp; diff --git a/composer.json b/composer.json index e5e8f85..05ebaf8 100644 --- a/composer.json +++ b/composer.json @@ -5,23 +5,24 @@ "license": "MIT", "type": "project", "require": { - "php": ">=7.1.3", + "php": "^7.1.3", "doctrine/dbal": "^2.6", "erusev/parsedown": "~1.6", - "fideloper/proxy": "~4.0", + "fideloper/proxy": "^4.0", "intervention/image": "^2.4", - "laravel/framework": "5.6.*", - "laravel/tinker": "~1.0", + "laravel/framework": "5.7.*", + "laravel/tinker": "^1.0", "phpoffice/phpspreadsheet": "^1.2", "radic/blade-extensions": "~7.0", "spatie/laravel-newsletter": "^4.2" }, "require-dev": { - "filp/whoops": "~2.0", - "fzaninotto/faker": "~1.4", - "mockery/mockery": "~1.0", - "nunomaduro/collision": "~2.0", - "phpunit/phpunit": "~7.0" + "beyondcode/laravel-dump-server": "^1.0", + "filp/whoops": "^2.0", + "fzaninotto/faker": "^1.4", + "mockery/mockery": "^1.0", + "nunomaduro/collision": "^2.0", + "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ @@ -48,11 +49,11 @@ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ - "@php artisan key:generate" + "@php artisan key:generate --ansi" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover" + "@php artisan package:discover --ansi" ] }, "config": { diff --git a/config/app.php b/config/app.php index 5da82a2..6a67ac7 100644 --- a/config/app.php +++ b/config/app.php @@ -10,6 +10,7 @@ return [ | This value is the name of your application. This value is used when the | framework needs to place the application's name in a notification or | any other location as required by the application or its packages. + | */ 'name' => env('APP_NAME', 'Laravel'), @@ -21,7 +22,7 @@ return [ | | 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. + | services the application utilizes. Set this in your ".env" file. | */ @@ -92,6 +93,19 @@ return [ 'fallback_locale' => 'en', + /* + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | + */ + + 'faker_locale' => 'en_US', + /* |-------------------------------------------------------------------------- | Encryption Key diff --git a/config/cache.php b/config/cache.php index 0aa4caa..ecb1204 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,5 +1,7 @@ [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => 'cache', ], ], @@ -86,9 +88,6 @@ return [ | */ - 'prefix' => env( - 'CACHE_PREFIX', - str_slug(env('APP_NAME', 'hypothetical'), '_').'_cache' - ), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'hypothetical'), '_').'_cache'), ]; diff --git a/config/session.php b/config/session.php index 787a38f..ae31ec6 100644 --- a/config/session.php +++ b/config/session.php @@ -1,5 +1,7 @@ null, + 'connection' => env('SESSION_CONNECTION', null), /* |-------------------------------------------------------------------------- @@ -96,7 +98,7 @@ return [ | */ - 'store' => null, + 'store' => env('SESSION_STORE', null), /* |-------------------------------------------------------------------------- @@ -124,7 +126,7 @@ return [ 'cookie' => env( 'SESSION_COOKIE', - str_slug(env('APP_NAME', 'hypothetical'), '_').'_session' + Str::slug(env('APP_NAME', 'hypothetical'), '_').'_session' ), /* diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 3c4b267..6645d7b 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -16,6 +16,7 @@ class CreateUsersTable extends Migration Schema::create('users', function(Blueprint $table) { $table->increments('id'); $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); $table->string('name'); $table->string('website')->nullable(); $table->string('facebook')->nullable(); diff --git a/readme.md b/readme.md index 9bc47b0..b2d816f 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ A Hypothetical website template for bootstrapping new projects. * Written and maintained by Kevin MacMartin -* Based on Laravel 5.6 +* Based on Laravel 5.7 ## Setup