From e760324076c4c721355ba026ce6d5a080f17b18b Mon Sep 17 00:00:00 2001 From: Anthony Rappa Date: Sat, 12 Dec 2020 20:06:42 -0500 Subject: [PATCH] Update to laravel commit: ddb26fbc504cd64fb1b89511773aa8d03c758c6d --- .gitignore | 1 + CHANGELOG.md | 3 + app/Exceptions/Handler.php | 10 ++ app/Providers/RouteServiceProvider.php | 2 +- composer.json | 17 +-- composer.lock | 170 ++++++++++++++++--------- config/app.php | 2 +- config/broadcasting.php | 5 + config/cache.php | 4 +- config/cors.php | 2 +- config/filesystems.php | 13 -- docker-composer.yml | 74 +++++++++++ package.json | 4 +- resources/lang/en/auth.php | 1 + 14 files changed, 223 insertions(+), 85 deletions(-) create mode 100644 docker-composer.yml diff --git a/.gitignore b/.gitignore index 8d1dccc8d5..96cf3efbaa 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ _ide_helper.php .project composer.phar coverage.xml +docker-compose.override.yml error.log Homestead.json Homestead.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 506758d2bf..8c64a12c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. ## Changed - Update dependencies +- Update to laravel commit: ddb26fbc504cd64fb1b89511773aa8d03c758c6d +- Update exception handling to match laravel +- Added sail docker file ## [8.0.0] - 2020-10-21 diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 91235675e1..c065d505ba 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -22,6 +22,16 @@ class Handler extends ExceptionHandler GeneralException::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. * diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 7082efead3..5aa67dc30d 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -71,7 +71,7 @@ public function boot() protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60); + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); }); } } diff --git a/composer.json b/composer.json index 65ad2996bb..95554cff66 100644 --- a/composer.json +++ b/composer.json @@ -9,18 +9,18 @@ ], "license": "MIT", "require": { - "php": "^7.3", + "php": "^7.3|^8.0", "arcanedev/log-viewer": "8.x", "darkghosthunter/laraguard": "dev-master", - "fideloper/proxy": "^4.2", + "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "jamesmills/laravel-timezone": "^1.9", "lab404/laravel-impersonate": "^1.6", "langleyfoxall/laravel-nist-password-rules": "^4.1", - "laravel/framework": "^8.0", + "laravel/framework": "^8.12", "laravel/socialite": "^5.0", - "laravel/tinker": "^2.0", + "laravel/tinker": "^2.5", "laravel/ui": "^3.0", "livewire/livewire": "^2.0", "rappasoft/laravel-livewire-tables": "^0.3", @@ -34,12 +34,13 @@ "barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-ide-helper": "^2.6", "codedungeon/phpunit-result-printer": "^0.29", - "facade/ignition": "^2.3.6", + "facade/ignition": "^2.5", "friendsofphp/php-cs-fixer": "^2.16", - "fzaninotto/faker": "^1.9.1", - "mockery/mockery": "^1.3.1", + "fakerphp/faker": "^1.9.1", + "laravel/sail": "^0.0.5", + "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3.3" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index 877f83a8da..54412f173a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18e8ca22890f38acf484c2be4b32608f", + "content-hash": "5f9d314dcc8ba37b7c46b9ed229e0a43", "packages": [ { "name": "arcanedev/log-viewer", @@ -8338,6 +8338,58 @@ }, "time": "2020-10-16T08:27:54+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.12.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "841e8bdde345cc1ea9f98e776959e7531cadea0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/841e8bdde345cc1ea9f98e776959e7531cadea0e", + "reference": "841e8bdde345cc1ea9f98e776959e7531cadea0e", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-intl": "*", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.12.1" + }, + "time": "2020-12-11T10:39:41+00:00" + }, { "name": "filp/whoops", "version": "2.9.1", @@ -8505,61 +8557,6 @@ ], "time": "2020-12-08T13:47:02+00:00" }, - { - "name": "fzaninotto/faker", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" - }, - "abandoned": true, - "time": "2020-12-11T09:56:16+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -8743,6 +8740,65 @@ }, "time": "2020-05-27T16:41:55+00:00" }, + { + "name": "laravel/sail", + "version": "v0.0.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "d9b0575ece889a35b9741789452c1c7abca5bc2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/d9b0575ece889a35b9741789452c1c7abca5bc2f", + "reference": "d9b0575ece889a35b9741789452c1c7abca5bc2f", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0|^9.0", + "illuminate/support": "^8.0|^9.0", + "php": "^7.3|^8.0" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2020-12-07T20:58:56+00:00" + }, { "name": "maximebf/debugbar", "version": "v1.16.4", @@ -11749,7 +11805,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.3" + "php": "^7.3|^8.0" }, "platform-dev": [], "plugin-api-version": "2.0.0" diff --git a/config/app.php b/config/app.php index 4abcfaf59d..975ef32d81 100644 --- a/config/app.php +++ b/config/app.php @@ -220,7 +220,7 @@ 'Password' => Illuminate\Support\Facades\Password::class, 'Queue' => Illuminate\Support\Facades\Queue::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, + // 'Redis' => Illuminate\Support\Facades\Redis::class, 'Request' => Illuminate\Support\Facades\Request::class, 'Response' => Illuminate\Support\Facades\Response::class, 'Route' => Illuminate\Support\Facades\Route::class, diff --git a/config/broadcasting.php b/config/broadcasting.php index 3bba1103e6..ef20859859 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -41,6 +41,11 @@ ], ], + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + 'redis' => [ 'driver' => 'redis', 'connection' => 'default', diff --git a/config/cache.php b/config/cache.php index 4f41fdf966..151a3232a7 100644 --- a/config/cache.php +++ b/config/cache.php @@ -13,8 +13,8 @@ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | - | Supported: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb" + | Supported drivers: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb", "null" | */ diff --git a/config/cors.php b/config/cors.php index 558369dca4..8a39e6daa6 100644 --- a/config/cors.php +++ b/config/cors.php @@ -15,7 +15,7 @@ | */ - 'paths' => ['api/*'], + 'paths' => ['api/*', 'sanctum/csrf-cookie'], 'allowed_methods' => ['*'], diff --git a/config/filesystems.php b/config/filesystems.php index 94c81126b2..10c9d9be2a 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -15,19 +15,6 @@ 'default' => env('FILESYSTEM_DRIVER', 'local'), - /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ - - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), - /* |-------------------------------------------------------------------------- | Filesystem Disks diff --git a/docker-composer.yml b/docker-composer.yml new file mode 100644 index 0000000000..051aad1d68 --- /dev/null +++ b/docker-composer.yml @@ -0,0 +1,74 @@ +# For more information: https://laravel.com/docs/sail +version: '3' +services: + laravel.test: + build: + context: ./vendor/laravel/sail/runtimes/8.0 + dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' + image: sail-8.0/app + ports: + - '${APP_PORT:-80}:80' + environment: + WWWUSER: '${WWWUSER}' + LARAVEL_SAIL: 1 + volumes: + - '.:/var/www/html' + networks: + - sail + depends_on: + - mysql + - redis + # - selenium + # selenium: + # image: 'selenium/standalone-chrome' + # volumes: + # - '/dev/shm:/dev/shm' + # networks: + # - sail + # depends_on: + # - laravel.test + mysql: + image: 'mysql:8.0' + ports: + - '${FORWARD_DB_PORT:-3306}:3306' + environment: + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' + MYSQL_DATABASE: '${DB_DATABASE}' + MYSQL_USER: '${DB_USERNAME}' + MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + volumes: + - 'sailmysql:/var/lib/mysql' + networks: + - sail + redis: + image: 'redis:alpine' + ports: + - '${FORWARD_REDIS_PORT:-6379}:6379' + volumes: + - 'sailredis:/data' + networks: + - sail + # memcached: + # image: 'memcached:alpine' + # ports: + # - '11211:11211' + # networks: + # - sail + mailhog: + image: 'mailhog/mailhog:latest' + ports: + - 1025:1025 + - 8025:8025 + networks: + - sail +networks: + sail: + driver: bridge +volumes: + sailmysql: + driver: local + sailredis: + driver: local diff --git a/package.json b/package.json index f78aac6bbd..cdfc4663ca 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "private": true, "scripts": { "dev": "npm run development", - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "@coreui/coreui": "^3.0.0", diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df290..6598e2c060 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -14,6 +14,7 @@ */ 'failed' => 'These credentials do not match our records.', + 'password' => 'The provided password is incorrect.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', ];