From c075767bf69a71c1a2f6e263de5e5c33212f2aeb Mon Sep 17 00:00:00 2001 From: Charalampos Raftopoulos Date: Sun, 14 Apr 2019 19:10:41 +0300 Subject: [PATCH 1/3] upgrade to Laravel v5.8, resolves #41 --- .env.example | 5 +++++ app/Http/Controllers/Auth/RegisterController.php | 2 +- composer.json | 6 +++--- config/app.php | 2 ++ config/auth.php | 1 + config/cache.php | 10 +++++++++- config/database.php | 12 +++++++++++- config/queue.php | 11 ++++++----- config/services.php | 10 +++++++--- database/factories/UserFactory.php | 6 ++++-- .../2014_10_12_000000_create_users_table.php | 2 +- phpunit.xml | 11 ++++++----- resources/lang/en/passwords.php | 2 +- 13 files changed, 57 insertions(+), 23 deletions(-) diff --git a/.env.example b/.env.example index afdc119..5651798 100644 --- a/.env.example +++ b/.env.example @@ -29,6 +29,11 @@ MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION= +AWS_BUCKET= + PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 1f10e04..8f3a2b9 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -51,7 +51,7 @@ protected function validator(array $data) return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], - 'password' => ['required', 'string', 'min:6', 'confirmed'], + 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); } diff --git a/composer.json b/composer.json index 846cbcd..0d3c0a2 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "type": "project", "require": { "php": ">=7.1.3", - "laravel/framework": "5.7.*", + "laravel/framework": "5.8.*", "lucid-arch/laravel-foundation": "5.7.*", "laravel/tinker": "^1.0", "fideloper/proxy": "~4.0" @@ -14,8 +14,8 @@ "require-dev": { "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", - "nunomaduro/collision": "^2.0", - "phpunit/phpunit": "~7.0", + "nunomaduro/collision": "^3.0", + "phpunit/phpunit": "^7.5", "symfony/css-selector": "~4.0", "symfony/dom-crawler": "~4.0", "lucid-arch/laravel-console": "5.7.*", diff --git a/config/app.php b/config/app.php index 6d8b298..5756763 100644 --- a/config/app.php +++ b/config/app.php @@ -193,6 +193,7 @@ 'aliases' => [ 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, @@ -222,6 +223,7 @@ 'Schema' => Illuminate\Support\Facades\Schema::class, 'Session' => Illuminate\Support\Facades\Session::class, 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, diff --git a/config/auth.php b/config/auth.php index 18e54ed..366f303 100644 --- a/config/auth.php +++ b/config/auth.php @@ -44,6 +44,7 @@ 'api' => [ 'driver' => 'token', 'provider' => 'users', + 'hash' => false, ], ], diff --git a/config/cache.php b/config/cache.php index 0c30969..ee3e073 100644 --- a/config/cache.php +++ b/config/cache.php @@ -13,7 +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" + | Supported: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb" | */ @@ -75,6 +76,13 @@ 'connection' => 'cache', ], + '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'), + ], ], /* diff --git a/config/database.php b/config/database.php index 899faa8..0b3c9de 100644 --- a/config/database.php +++ b/config/database.php @@ -1,5 +1,7 @@ true, 'strict' => true, 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], ], 'pgsql' => [ @@ -97,7 +102,12 @@ 'redis' => [ - 'client' => 'predis', + 'client' => env('REDIS_CLIENT', 'predis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'predis'), + 'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_', + ], 'default' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), diff --git a/config/queue.php b/config/queue.php index 9a03900..8d3dcaf 100644 --- a/config/queue.php +++ b/config/queue.php @@ -46,15 +46,16 @@ 'host' => 'localhost', 'queue' => 'default', 'retry_after' => 90, + 'block_for' => 0, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', - 'secret' => 'your-secret-key', - 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', - 'region' => 'us-east-1', + '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('AWS_DEFAULT_REGION', 'us-east-1'), ], 'redis' => [ diff --git a/config/services.php b/config/services.php index dfdc56e..d834797 100644 --- a/config/services.php +++ b/config/services.php @@ -20,10 +20,14 @@ 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), ], + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), + ], + 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => env('SES_REGION', 'us-east-1'), + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'sparkpost' => [ diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 74195da..87f37ff 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,6 +1,8 @@ define(Framework\User::class, function (Faker $faker) { + $factory->define(User::class, function (Faker $faker) { return [ 'name' => $faker->name, 'email' => $faker->unique()->safeEmail, 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 b1308d7..e8c97c1 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -14,7 +14,7 @@ class CreateUsersTable extends Migration public function up() { Schema::create('users', function (Blueprint $table) { - $table->increments('id'); + $table->bigIncrements('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); diff --git a/phpunit.xml b/phpunit.xml index a589188..13ed52a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -30,10 +30,11 @@ - - - - - + + + + + + diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e5544d2..bf6caf6 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -13,7 +13,7 @@ | */ - 'password' => 'Passwords must be at least six characters and match the confirmation.', + 'password' => 'Passwords must be at least eight characters and match the confirmation.', 'reset' => 'Your password has been reset!', 'sent' => 'We have e-mailed your password reset link!', 'token' => 'This password reset token is invalid.', From 3cf1e5a4193367246da2261b4ae6c90e568d13f4 Mon Sep 17 00:00:00 2001 From: Charalampos Raftopoulos Date: Sun, 14 Apr 2019 19:19:03 +0300 Subject: [PATCH 2/3] update lucid dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0d3c0a2..1d6a38b 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "require": { "php": ">=7.1.3", "laravel/framework": "5.8.*", - "lucid-arch/laravel-foundation": "5.7.*", + "lucid-arch/laravel-foundation": "5.8.*", "laravel/tinker": "^1.0", "fideloper/proxy": "~4.0" }, @@ -18,7 +18,7 @@ "phpunit/phpunit": "^7.5", "symfony/css-selector": "~4.0", "symfony/dom-crawler": "~4.0", - "lucid-arch/laravel-console": "5.7.*", + "lucid-arch/laravel-console": "5.8.*", "beyondcode/laravel-dump-server": "^1.0", "filp/whoops": "^2.0" }, From 3194d51cf51732c0dda6610f66851b81ced52761 Mon Sep 17 00:00:00 2001 From: Charalampos Raftopoulos Date: Sun, 14 Apr 2019 19:20:47 +0300 Subject: [PATCH 3/3] update readme --- readme.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index b28eb02..5d80c5f 100644 --- a/readme.md +++ b/readme.md @@ -28,14 +28,22 @@ If you prefer a video, watch the announcement of The Lucid Architecture at Larac - [Microservices](#microservices) ## Installation -### 5.7 + +### 5.8 To start your project with Lucid right away, run the following command: ``` composer create-project lucid-arch/laravel my-project ``` -This will give you a Laravel 5.7 installation with Lucid out-of-the-box. If you wish to download other versions of Laravel you may specify it as well: +This will give you a Laravel 5.8 installation with Lucid out-of-the-box. If you wish to download other versions of Laravel you may specify it as well: + +##### 5.7 +``` +composer create-project lucid-arch/laravel=5.7.x my-project-5.7 +``` + +> Literally 5.7.x and not 5.7.0 or 5.7.1... ##### 5.6 ``` @@ -59,16 +67,6 @@ composer create-project lucid-arch/laravel=5.4.x my-project-5.4 composer create-project lucid-arch/laravel=5.3.x my-project-5.3 ``` -##### 5.2 -``` -composer create-project lucid-arch/laravel=5.2.x my-project-5.2 -``` - -##### 5.1 -``` -composer create-project lucid-arch/laravel=5.1.x my-project-5.1 -``` - ## Introduction ### Directory Structure