Follow laravel upgrade guide

This commit is contained in:
Jonny Barnes 2020-10-19 19:41:50 +01:00
parent 57186c3e2e
commit ed54446f87
37 changed files with 412 additions and 259 deletions

View file

@ -21,7 +21,7 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)

View file

@ -46,6 +46,7 @@ class Handler extends ExceptionHandler
* @param Throwable $throwable
* @return void
* @throws Exception
* @throws Throwable
*/
public function report(Throwable $throwable)
{

View file

@ -14,8 +14,10 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
@ -42,8 +44,8 @@ class Kernel extends HttpKernel
],
'api' => [
'throttle:60,1',
'bindings',
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
@ -57,10 +59,10 @@ class Kernel extends HttpKernel
protected $routeMiddleware = [
'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,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
@ -68,20 +70,4 @@ class Kernel extends HttpKernel
'myauth' => \App\Http\Middleware\MyAuthMiddleware::class,
'cors' => \App\Http\Middleware\CorsHeaders::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global 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,
];
}

View file

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}

View file

@ -2,12 +2,11 @@
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
/**
* @codeCoverageIgnore
*/
class RedirectIfAuthenticated
{
/**
@ -15,13 +14,17 @@ class RedirectIfAuthenticated
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param string|null ...$guards
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
public function handle(Request $request, Closure $next, ...$guards)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);

View file

@ -0,0 +1,20 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array
*/
public function hosts()
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}

View file

@ -7,6 +7,7 @@ namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Carbon;
@ -42,6 +43,8 @@ use Illuminate\Support\Carbon;
*/
class Bookmark extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*

View file

@ -7,6 +7,7 @@ namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Carbon;
@ -33,6 +34,8 @@ use Illuminate\Support\Carbon;
*/
class Tag extends Model
{
use HasFactory;
/**
* We shall set a blacklist of non-modifiable model attributes.
*

View file

@ -6,6 +6,7 @@ namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Notifications\DatabaseNotificationCollection;
@ -36,6 +37,7 @@ use Illuminate\Support\Carbon;
*/
class User extends Authenticatable
{
use HasFactory;
use Notifiable;
/**

View file

@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
@ -12,7 +13,7 @@ class AuthServiceProvider extends ServiceProvider
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**

View file

@ -15,6 +15,7 @@
"ext-dom": "*",
"cviebrock/eloquent-sluggable": "^8.0",
"fideloper/proxy": "~4.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"indieauth/client": "~0.1",
"intervention/image": "^2.4",

157
composer.lock generated
View file

@ -4,8 +4,64 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c3028e72c591a7b87bca672b158d7e3c",
"content-hash": "cf573bfdecec40388c59b9d24d857126",
"packages": [
{
"name": "asm89/stack-cors",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/asm89/stack-cors.git",
"reference": "23f469e81c65e2fb7fc7bce371fbdc363fe32adf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/asm89/stack-cors/zipball/23f469e81c65e2fb7fc7bce371fbdc363fe32adf",
"reference": "23f469e81c65e2fb7fc7bce371fbdc363fe32adf",
"shasum": ""
},
"require": {
"php": "^7.0",
"symfony/http-foundation": "~2.7|~3.0|~4.0|~5.0",
"symfony/http-kernel": "~2.7|~3.0|~4.0|~5.0"
},
"require-dev": {
"phpunit/phpunit": "^6|^7|^8|^9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Asm89\\Stack\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexander",
"email": "iam.asm89@gmail.com"
}
],
"description": "Cross-origin resource sharing library and stack middleware",
"homepage": "https://github.com/asm89/stack-cors",
"keywords": [
"cors",
"stack"
],
"support": {
"issues": "https://github.com/asm89/stack-cors/issues",
"source": "https://github.com/asm89/stack-cors/tree/master"
},
"time": "2020-05-31T07:17:05+00:00"
},
{
"name": "aws/aws-sdk-php",
"version": "3.158.8",
@ -824,6 +880,83 @@
},
"time": "2020-06-23T01:36:47+00:00"
},
{
"name": "fruitcake/laravel-cors",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-cors.git",
"reference": "4b19bfc3bd422948af37a42a62fad7f49025894a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/4b19bfc3bd422948af37a42a62fad7f49025894a",
"reference": "4b19bfc3bd422948af37a42a62fad7f49025894a",
"shasum": ""
},
"require": {
"asm89/stack-cors": "^2.0.1",
"illuminate/contracts": "^6|^7|^8",
"illuminate/support": "^6|^7|^8",
"php": ">=7.2",
"symfony/http-foundation": "^4|^5",
"symfony/http-kernel": "^4.3.4|^5"
},
"require-dev": {
"laravel/framework": "^6|^7|^8",
"orchestra/testbench-dusk": "^4|^5|^6",
"phpunit/phpunit": "^6|^7|^8",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
},
"laravel": {
"providers": [
"Fruitcake\\Cors\\CorsServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Fruitcake\\Cors\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fruitcake",
"homepage": "https://fruitcake.nl"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application",
"keywords": [
"api",
"cors",
"crossdomain",
"laravel"
],
"support": {
"issues": "https://github.com/fruitcake/laravel-cors/issues",
"source": "https://github.com/fruitcake/laravel-cors/tree/master"
},
"funding": [
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2020-09-07T11:48:52+00:00"
},
{
"name": "graham-campbell/result-type",
"version": "v1.0.1",
@ -2022,16 +2155,16 @@
},
{
"name": "league/commonmark",
"version": "1.5.5",
"version": "1.5.6",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "45832dfed6007b984c0d40addfac48d403dc6432"
"reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/45832dfed6007b984c0d40addfac48d403dc6432",
"reference": "45832dfed6007b984c0d40addfac48d403dc6432",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/a56e91e0fa1f6d0049153a9c34f63488f6b7ce61",
"reference": "a56e91e0fa1f6d0049153a9c34f63488f6b7ce61",
"shasum": ""
},
"require": {
@ -2119,7 +2252,7 @@
"type": "tidelift"
}
],
"time": "2020-09-13T14:44:46+00:00"
"time": "2020-10-17T21:33:03+00:00"
},
{
"name": "league/flysystem",
@ -2334,16 +2467,16 @@
},
{
"name": "league/mime-type-detection",
"version": "1.5.0",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/mime-type-detection.git",
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28"
"reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28",
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa",
"reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa",
"shasum": ""
},
"require": {
@ -2373,7 +2506,7 @@
"description": "Mime-type detection for Flysystem",
"support": {
"issues": "https://github.com/thephpleague/mime-type-detection/issues",
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.0"
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.1"
},
"funding": [
{
@ -2385,7 +2518,7 @@
"type": "tidelift"
}
],
"time": "2020-09-21T18:10:53+00:00"
"time": "2020-10-18T11:50:25+00:00"
},
{
"name": "league/uri-parser",

View file

@ -22,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.
|
*/
@ -39,7 +39,7 @@ return [
|
*/
'debug' => env('APP_DEBUG', false),
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
@ -207,6 +207,10 @@ return [
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
@ -238,6 +242,7 @@ return [
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
@ -249,6 +254,7 @@ return [
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,

View file

@ -44,6 +44,7 @@ return [
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
@ -96,7 +97,21 @@ return [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

View file

@ -39,6 +39,7 @@ return [
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
@ -73,7 +74,7 @@ return [
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'connection' => 'cache',
],
'dynamodb' => [
@ -98,6 +99,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

@ -46,7 +46,7 @@ return [
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
@ -66,7 +66,7 @@ return [
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
@ -91,17 +91,6 @@ return [
'prefix_indexes' => true,
],
'travis' => [
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'travis_ci_test',
'username' => 'travis',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
]
],
/*
@ -134,23 +123,23 @@ return [
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],

View file

@ -8,8 +8,8 @@ return [
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
@ -37,7 +37,7 @@ return [
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "s3", "rackspace"
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
@ -57,11 +57,12 @@ return [
's3' => [
'driver' => 's3',
'key' => env('AWS_S3_KEY'),
'secret' => env('AWS_S3_SECRET'),
'region' => env('AWS_S3_REGION'),
'bucket' => env('AWS_S3_BUCKET'),
'url' => env('AWS_S3_URL'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
'media' => [
@ -71,4 +72,19 @@ return [
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

View file

@ -27,9 +27,11 @@ return [
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
@ -40,6 +42,7 @@ return [
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,

View file

@ -1,6 +1,6 @@
<?php
return array(
return [
/*
|--------------------------------------------------------------------------
@ -15,6 +15,6 @@ return array(
|
*/
'driver' => 'imagick'
'driver' => 'imagick',
);
];

View file

@ -37,20 +37,20 @@ return [
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
@ -59,12 +59,12 @@ return [
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
@ -83,18 +83,22 @@ return [
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
'slack' => env('LOG_SLACK_WEBHOOK_URL'),

View file

@ -4,45 +4,73 @@ return [
/*
|--------------------------------------------------------------------------
| Mail Driver
| Default Mailer
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
| Supported: "smtp", "sendmail", "mailgun", "ses"
*/
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'ses' => [
'transport' => 'ses',
],
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'mailgun' => [
'transport' => 'mailgun',
],
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'postmark' => [
'transport' => 'postmark',
],
'port' => env('MAIL_PORT', 587),
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
],
/*
|--------------------------------------------------------------------------
@ -54,52 +82,12 @@ return [
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
@ -119,17 +107,4 @@ return [
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

View file

@ -51,11 +51,12 @@ return [
'sqs' => [
'driver' => 'sqs',
'key' => env('SQS_KEY', 'your-public-key'),
'secret' => env('SQS_SECRET', 'your-secret-key'),
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('SQS_REGION', 'us-east-1'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
@ -80,7 +81,7 @@ return [
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],

View file

@ -8,9 +8,9 @@ return [
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
@ -25,9 +25,9 @@ return [
],
'ses' => [
'key' => env('SES_KEY'),
'secret' => env('SES_SECRET'),
'region' => 'us-east-1',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];

View file

@ -92,9 +92,11 @@ return [
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
@ -166,7 +168,7 @@ return [
|
*/
'secure' => env('SESSION_SECURE_COOKIE', null),
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
@ -188,12 +190,12 @@ return [
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
| will set this value to "lax" since this is a secure default value.
|
| Supported: "lax", "strict"
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => null,
'same_site' => 'lax',
];

View file

@ -2,10 +2,8 @@
namespace Database\Seeders;
use Illuminate\Support\Carbon;
use App\Models\{Bookmark, Tag};
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class BookmarksTableSeeder extends Seeder
{
@ -16,17 +14,8 @@ class BookmarksTableSeeder extends Seeder
*/
public function run()
{
Bookmark::factory(10)->create();
factory(Bookmark::class, 10)->create()->each(function ($bookmark) {
$bookmark->tags()->save(factory(Tag::class)->make());
$now = Carbon::now()->subDays(rand(2, 12));
DB::table('bookmarks')
->where('id', $bookmark->id)
->update([
'created_at' => $now->toDateTimeString(),
'updated_at' => $now->toDateTimeString(),
]);
});
Bookmark::factory(10)
->has(Tag::factory()->count(1))
->create();
}
}

View file

@ -1,5 +1,7 @@
<?php
use Illuminate\Support\Facades\Broadcast;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
@ -11,6 +13,6 @@
|
*/
Broadcast::channel('App.User.{id}', function ($user, $id) {
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});

View file

@ -1,6 +1,7 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
/*
|--------------------------------------------------------------------------

View file

@ -12,7 +12,7 @@ class AdminHomeControllerTest extends TestCase
public function test_admin_homepage()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin');

View file

@ -13,7 +13,7 @@ class ArticlesTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/blog');
@ -22,7 +22,7 @@ class ArticlesTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/blog/create');
@ -31,7 +31,7 @@ class ArticlesTest extends TestCase
public function test_create_new_article()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/blog', [
@ -43,7 +43,7 @@ class ArticlesTest extends TestCase
public function test_create_new_article_with_upload()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$faker = \Faker\Factory::create();
$text = $faker->text;
if ($fh = fopen(sys_get_temp_dir() . '/article.md', 'w')) {
@ -67,7 +67,7 @@ class ArticlesTest extends TestCase
public function test_see_edit_form()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/blog/1/edit');
@ -76,7 +76,7 @@ class ArticlesTest extends TestCase
public function test_edit_article()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/blog/1', [
@ -92,7 +92,7 @@ class ArticlesTest extends TestCase
public function test_delete_article()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/blog/1', [

View file

@ -12,7 +12,7 @@ class ClientsTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/clients');
@ -21,7 +21,7 @@ class ClientsTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/clients/create');
@ -30,7 +30,7 @@ class ClientsTest extends TestCase
public function test_create_new_client()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/clients', [
@ -45,7 +45,7 @@ class ClientsTest extends TestCase
public function test_see_edit_form()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/clients/1/edit');
@ -54,7 +54,7 @@ class ClientsTest extends TestCase
public function test_edit_client()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/clients/1', [
@ -70,7 +70,7 @@ class ClientsTest extends TestCase
public function test_delete_client()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/clients/1', [

View file

@ -27,7 +27,7 @@ class ContactsTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts');
$response->assertViewIs('admin.contacts.index');
@ -35,7 +35,7 @@ class ContactsTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts/create');
$response->assertViewIs('admin.contacts.create');
@ -43,7 +43,7 @@ class ContactsTest extends TestCase
public function test_create_new_contact()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/contacts', [
'name' => 'Fred Bloggs',
@ -59,7 +59,7 @@ class ContactsTest extends TestCase
public function test_see_edit_form()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts/1/edit');
$response->assertViewIs('admin.contacts.edit');
@ -67,7 +67,7 @@ class ContactsTest extends TestCase
public function test_update_contact_no_uploaded_avatar()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/contacts/1', [
'_method' => 'PUT',
@ -87,7 +87,7 @@ class ContactsTest extends TestCase
copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
$path = sys_get_temp_dir() . '/tantek.png';
$file = new UploadedFile($path, 'tantek.png', 'image/png', null, true);
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/contacts/1', [
'_method' => 'PUT',
@ -105,7 +105,7 @@ class ContactsTest extends TestCase
public function test_delete_contact()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/contacts/1', [
'_method' => 'DELETE',
@ -130,7 +130,7 @@ HTML;
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$this->app->instance(Client::class, $client);
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->get('/admin/contacts/1/getavatar');
@ -148,7 +148,7 @@ HTML;
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$this->app->instance(Client::class, $client);
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
@ -169,7 +169,7 @@ HTML;
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$this->app->instance(Client::class, $client);
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts/1/getavatar');
@ -182,7 +182,7 @@ HTML;
'nick' => 'fred',
'name' => 'Fred Bloggs',
]);
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/contacts/' . $contact->id . '/getavatar');

View file

@ -15,7 +15,7 @@ class LikesTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/likes');
@ -24,7 +24,7 @@ class LikesTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/likes/create');
@ -34,7 +34,7 @@ class LikesTest extends TestCase
public function test_create_new_like()
{
Queue::fake();
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/likes', [
@ -48,7 +48,7 @@ class LikesTest extends TestCase
public function test_see_edit_form()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)
->get('/admin/likes/1/edit');
@ -58,7 +58,7 @@ class LikesTest extends TestCase
public function test_edit_like()
{
Queue::fake();
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/likes/1', [
@ -75,7 +75,7 @@ class LikesTest extends TestCase
{
$like = Like::find(1);
$url = $like->url;
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)
->post('/admin/likes/1', [

View file

@ -14,7 +14,7 @@ class NotesTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/notes');
$response->assertViewIs('admin.notes.index');
@ -22,7 +22,7 @@ class NotesTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/notes/create');
$response->assertViewIs('admin.notes.create');
@ -30,7 +30,7 @@ class NotesTest extends TestCase
public function test_create_a_new_note()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/notes', [
'content' => 'A new test note',
@ -42,7 +42,7 @@ class NotesTest extends TestCase
public function test_edit_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/notes/1/edit');
$response->assertViewIs('admin.notes.edit');
@ -51,7 +51,7 @@ class NotesTest extends TestCase
public function test_edit_a_note()
{
Queue::fake();
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/notes/1', [
'_method' => 'PUT',
@ -67,7 +67,7 @@ class NotesTest extends TestCase
public function test_delete_note()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/notes/1', [
'_method' => 'DELETE',

View file

@ -12,7 +12,7 @@ class PlacesTest extends TestCase
public function test_index_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/places');
$response->assertViewIs('admin.places.index');
@ -20,7 +20,7 @@ class PlacesTest extends TestCase
public function test_create_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/places/create');
$response->assertViewIs('admin.places.create');
@ -28,7 +28,7 @@ class PlacesTest extends TestCase
public function test_create_new_place()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/places', [
'name' => 'Test Place',
@ -44,7 +44,7 @@ class PlacesTest extends TestCase
public function test_edit_page()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$response = $this->actingAs($user)->get('/admin/places/1/edit');
$response->assertViewIs('admin.places.edit');
@ -52,7 +52,7 @@ class PlacesTest extends TestCase
public function test_updating_a_place()
{
$user = factory(User::class)->create();
$user = User::factory()->make();
$this->actingAs($user)->post('/admin/places/1', [
'_method' => 'PUT',

View file

@ -1,15 +0,0 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class SessionStoreControllerTest extends TestCase
{
public function test_colour_preference_saved()
{
$response = $this->post('update-colour-scheme', ['css' => 'some.css']);
$response->assertJson(['status' => 'ok']);
}
}

View file

@ -19,12 +19,6 @@ class ShortURLsControllerTest extends TestCase
$response->assertRedirect('https://twitter.com/jonnybarnes');
}
public function test_short_domain_slashplus_redirects_to_googleplus()
{
$response = $this->get('http://' . config('app.shorturl') . '/+');
$response->assertRedirect('https://plus.google.com/u/0/117317270900655269082/about');
}
public function test_short_domain_slasht_redirects_to_long_domain_slash_notes()
{
$response = $this->get('http://' . config('app.shorturl') . '/t/E');

View file

@ -64,7 +64,7 @@ class PlacesTest extends TestCase
]
]);
$this->assertInstanceOf('App\Models\Place', $ret); // a place was returned
$this->assertEquals(2, count(Place::all())); // still 2 places
$this->assertEquals(12, count(Place::all())); // still 2 places
}
public function test_service_requires_name()