Upgrade to laravel 5.6

This commit is contained in:
Kevin MacMartin 2018-03-05 18:45:02 -05:00
parent 56608192be
commit 7d9aa98eb0
18 changed files with 639 additions and 491 deletions

View file

@ -3,11 +3,12 @@ DEFAULT_LANGUAGE=en
APP_NAME='Hypothetical Template' APP_NAME='Hypothetical Template'
APP_DESC='A website template' APP_DESC='A website template'
APP_ENV=local APP_ENV=local
APP_KEY=
APP_DEBUG=true APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost APP_URL=http://localhost
APP_KEY= LOG_CHANNEL=stack
CACHE_BUST= CACHE_BUST=
LR_HOST=localhost LR_HOST=localhost
@ -19,9 +20,10 @@ DB_DATABASE=hypothetical
DB_USERNAME=homestead DB_USERNAME=homestead
DB_PASSWORD=secret DB_PASSWORD=secret
CACHE_DRIVER=file
BROADCAST_DRIVER=log BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1 REDIS_HOST=127.0.0.1
@ -37,6 +39,14 @@ MAIL_ENCRYPTION=tls
MAIL_SENDFROM=null MAIL_SENDFROM=null
MAIL_SENDTO=null MAIL_SENDTO=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
MAILCHIMP_APIKEY=null MAILCHIMP_APIKEY=null
MAILCHIMP_LISTID=null MAILCHIMP_LISTID=null

22
.gitignore vendored
View file

@ -1,14 +1,18 @@
/vendor .DS_Store
/node_modules /.env
/.idea
/.vagrant
/.vscode
/npm-debug.log
/yarn-error.log
/bower_components /bower_components
/public/hot /node_modules
/public/storage
/public/css /public/css
/public/js
/public/fonts /public/fonts
/public/hot
/public/js
/public/storage
/public/uploads /public/uploads
/storage/*.key
/storage/exports /storage/exports
/storage.*.key /vendor
npm-debug.log
yarn-error.log
.env

View file

@ -1 +1 @@
4bbd5f9be579d5e69fe784216298d9f06824d6c2 ff2f828c55ae9cf1cc3b0d75aa255759b63bf947

View file

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
use App\User; use App\User;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Foundation\Auth\RegistersUsers;
@ -66,7 +67,7 @@ class RegisterController extends Controller
return User::create([ return User::create([
'name' => $data['name'], 'name' => $data['name'],
'email' => $data['email'], 'email' => $data['email'],
'password' => bcrypt($data['password']), 'password' => Hash::make($data['password']),
'api_token' => str_random(60) 'api_token' => str_random(60)
]); ]);
} }

View file

@ -54,6 +54,7 @@ class Kernel extends HttpKernel
'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,

View file

@ -15,15 +15,9 @@ class TrustProxies extends Middleware
protected $proxies; protected $proxies;
/** /**
* The current proxy header mappings. * The headers that should be used to detect proxies.
* *
* @var array * @var string
*/ */
protected $headers = [ protected $headers = Request::HEADER_X_FORWARDED_ALL;
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',
];
} }

View file

@ -5,22 +5,23 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": ">=7.0.0", "php": ">=7.1.3",
"doctrine/dbal": "^2.6", "doctrine/dbal": "^2.6",
"erusev/parsedown": "~1.5", "erusev/parsedown": "~1.6",
"fideloper/proxy": "~3.3", "fideloper/proxy": "~4.0",
"intervention/image": "^2.3", "intervention/image": "^2.4",
"laravel/framework": "5.5.*", "laravel/framework": "5.6.*",
"laravel/tinker": "~1.0", "laravel/tinker": "~1.0",
"maatwebsite/excel": "^2.1", "maatwebsite/excel": "^2.1",
"radic/blade-extensions": "~7.0", "radic/blade-extensions": "~7.0",
"spatie/laravel-newsletter": "^4.1.0" "spatie/laravel-newsletter": "^4.2"
}, },
"require-dev": { "require-dev": {
"filp/whoops": "~2.0", "filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*", "mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0" "nunomaduro/collision": "~2.0",
"phpunit/phpunit": "~7.0"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
@ -58,5 +59,7 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"optimize-autoloader": true "optimize-autoloader": true
} },
"minimum-stability": "dev",
"prefer-stable": true
} }

906
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -107,23 +107,6 @@ return [
'cipher' => 'AES-256-CBC', 'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => env('APP_LOG', 'single'),
'log_level' => env('APP_LOG_LEVEL', 'debug'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Autoloaded Service Providers | Autoloaded Service Providers

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'),
'encrypted' => true,
], ],
], ],

View file

@ -37,7 +37,7 @@ return [
| may even configure multiple disks of the same driver. Defaults have | may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options. | been setup for each driver as an example of the required options.
| |
| Supported Drivers: "local", "ftp", "s3", "rackspace" | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
| |
*/ */
@ -57,10 +57,11 @@ return [
's3' => [ 's3' => [
'driver' => 's3', 'driver' => 's3',
'key' => env('AWS_KEY'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_REGION'), 'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'), 'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
], ],
], ],

20
config/hashing.php Normal file
View file

@ -0,0 +1,20 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon"
|
*/
'driver' => 'bcrypt',
];

70
config/logging.php Normal file
View file

@ -0,0 +1,70 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 7,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

View file

@ -50,11 +50,11 @@ return [
'sqs' => [ 'sqs' => [
'driver' => 'sqs', 'driver' => 'sqs',
'key' => 'your-public-key', 'key' => env('SQS_KEY', 'your-public-key'),
'secret' => 'your-secret-key', 'secret' => env('SQS_SECRET', 'your-secret-key'),
'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => 'your-queue-name', 'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => 'us-east-1', 'region' => env('SQS_REGION', 'us-east-1'),
], ],
'redis' => [ 'redis' => [
@ -62,6 +62,7 @@ return [
'connection' => 'default', 'connection' => 'default',
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'block_for' => null,
], ],
], ],

View file

@ -29,7 +29,7 @@ return [
| |
*/ */
'lifetime' => 120, 'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false, 'expire_on_close' => false,

View file

@ -14,12 +14,10 @@ use Faker\Generator as Faker;
*/ */
$factory->define(App\User::class, function (Faker $faker) { $factory->define(App\User::class, function (Faker $faker) {
static $password;
return [ return [
'name' => $faker->name, 'name' => $faker->name,
'email' => $faker->unique()->safeEmail, 'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'), 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10), 'remember_token' => str_random(10),
]; ];
}); });

View file

@ -5,6 +5,10 @@
RewriteEngine On RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder... # Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$ RewriteCond %{REQUEST_URI} (.+)/$
@ -14,8 +18,4 @@
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule> </IfModule>

View file

@ -2,6 +2,7 @@
namespace Tests; namespace Tests;
use Illuminate\Support\Facades\Hash;
use Illuminate\Contracts\Console\Kernel; use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication trait CreatesApplication
@ -17,6 +18,8 @@ trait CreatesApplication
$app->make(Kernel::class)->bootstrap(); $app->make(Kernel::class)->bootstrap();
Hash::driver('bcrypt')->setRounds(4);
return $app; return $app;
} }
} }