diff --git a/app/Models/Repository.php b/app/Models/Repository.php index 15b5bf89e..7cb0e6c38 100644 --- a/app/Models/Repository.php +++ b/app/Models/Repository.php @@ -2,12 +2,12 @@ namespace App\Models; -use Illuminate\Support\Str; use App\Models\Enums\RepositoryType; use App\Models\Presenters\RepositoryPresenter; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; +use Illuminate\Support\Str; class Repository extends Model { diff --git a/composer.json b/composer.json index 0236ceeb9..5b14ec6f6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "license": "MIT", "type": "project", "require": { - "php": "^7.1.3", + "php": "^7.2", "abraham/twitteroauth": "^0.9.2", "barryvdh/laravel-debugbar": "^3.0", "barryvdh/laravel-ide-helper": "^2.4", @@ -20,8 +20,8 @@ "fideloper/proxy": "^4.0", "guzzlehttp/guzzle": "~6.0", "knplabs/github-api": "^2.8", - "laravel/framework": "5.8.*", - "laravel/horizon": "^1.3", + "laravel/framework": "^6.0", + "laravel/horizon": "^3.2.7", "laravel/slack-notification-channel": "^2.0", "laravel/tinker": "^1.0", "myclabs/php-enum": "^1.5", @@ -30,12 +30,12 @@ "php-http/guzzle6-adapter": "^1.1", "php-http/message": "^1.7", "predis/predis": "^1.1", - "spatie/laravel-backup": "^6.0", - "spatie/laravel-cors": "^1.2", - "spatie/laravel-medialibrary": "^7.0", - "spatie/laravel-menu": "^3.1", - "spatie/laravel-responsecache": "^4.4", - "spatie/laravel-tail": "^3.0", + "spatie/laravel-backup": "^6.4", + "spatie/laravel-cors": "^1.6", + "spatie/laravel-medialibrary": "^7.12", + "spatie/laravel-menu": "^3.4", + "spatie/laravel-responsecache": "^6.2", + "spatie/laravel-tail": "^3.3", "spatie/packagist-api": "^1.0", "spatie/schema-org": "^2.0", "spatie/valuestore": "^1.2", @@ -44,14 +44,13 @@ "zendframework/zend-http": "^2.7" }, "require-dev": { - "filp/whoops": "^2.0", "friendsofphp/php-cs-fixer": "^2.4", "fzaninotto/faker": "^1.4", "laravel/envoy": "^1.3", "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5", - "beyondcode/laravel-dump-server": "^1.0", - "nunomaduro/collision": "^2.0" + "phpunit/phpunit": "^8.0", + "nunomaduro/collision": "^3.0", + "facade/ignition": "^1.4" }, "autoload": { "classmap": [ @@ -100,4 +99,4 @@ "dont-discover": [] } } -} +} \ No newline at end of file diff --git a/config/app.php b/config/app.php index 9a67a5c3b..efb9e8329 100644 --- a/config/app.php +++ b/config/app.php @@ -195,6 +195,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, @@ -226,6 +227,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/broadcasting.php b/config/broadcasting.php index 3ca45eaa8..3bba1103e 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -37,7 +37,7 @@ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'encrypted' => true, + 'useTLS' => true, ], ], diff --git a/config/cache.php b/config/cache.php index 49767228e..46751e627 100644 --- a/config/cache.php +++ b/config/cache.php @@ -80,8 +80,9 @@ 'driver' => 'dynamodb', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_REGION', 'us-east-1'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), ], ], diff --git a/config/database.php b/config/database.php index 77c31843e..199382d0c 100644 --- a/config/database.php +++ b/config/database.php @@ -1,5 +1,7 @@ [ 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), @@ -42,6 +45,7 @@ 'mysql' => [ 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), @@ -54,13 +58,14 @@ 'prefix_indexes' => true, 'strict' => true, 'engine' => null, - 'options' => array_filter([ + 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), - ]), + ]) : [], ], 'pgsql' => [ 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), @@ -75,6 +80,7 @@ 'sqlsrv' => [ 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '1433'), 'database' => env('DB_DATABASE', 'forge'), @@ -113,13 +119,15 @@ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'predis'), + 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'predis'), + 'cluster' => env('REDIS_CLUSTER', 'redis'), + '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), @@ -127,6 +135,7 @@ ], 'cache' => [ + 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), diff --git a/config/filesystems.php b/config/filesystems.php index 63e634b00..ec6a7cec3 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -37,7 +37,7 @@ | 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" | */ @@ -48,11 +48,6 @@ 'root' => storage_path('app'), ], - 'backups' => [ - 'driver' => 'local', - 'root' => storage_path('app/backups'), - ], - 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), @@ -62,18 +57,13 @@ 's3' => [ 'driver' => 's3', - 'key' => env('AWS_KEY'), - 'secret' => env('AWS_SECRET'), - 'region' => env('AWS_REGION'), + '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'), ], - 'medialibrary' => [ - 'driver' => 'local', - 'root' => public_path('images/medialibrary'), - 'url' => '/images/medialibrary', - 'visibility' => 'public', - ] ], ]; diff --git a/config/mail.php b/config/mail.php index f4006459a..3c65eb3fb 100644 --- a/config/mail.php +++ b/config/mail.php @@ -11,8 +11,8 @@ | sending of e-mail. You may specify which one you're using throughout | your application here. By default, Laravel is setup for SMTP mail. | - | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses", - | "sparkpost", "log", "array" + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" | */ diff --git a/config/queue.php b/config/queue.php index ec520ec6f..3a30d6c68 100644 --- a/config/queue.php +++ b/config/queue.php @@ -55,7 +55,7 @@ '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_REGION', 'us-east-1'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'redis' => [ @@ -80,6 +80,7 @@ */ 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], diff --git a/config/services.php b/config/services.php index 5a2eb4bae..2a1d616c7 100644 --- a/config/services.php +++ b/config/services.php @@ -8,26 +8,16 @@ |-------------------------------------------------------------------------- | | 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. | */ - 'twitter' => [ - 'consumer_key' => env('TWITTER_CONSUMER_KEY'), - 'consumer_secret' => env('TWITTER_CONSUMER_SECRET'), - 'access_token' => env('TWITTER_ACCESS_TOKEN'), - 'access_token_secret' => env('TWITTER_ACCESS_TOKEN_SECRET'), - ], - - 'google_api' => [ - 'key' => env('GOOGLE_API_KEY'), - ], - 'mailgun' => [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), ], 'postmark' => [ @@ -35,42 +25,9 @@ ], 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => 'us-east-1', - ], - - 'sparkpost' => [ - 'secret' => env('SPARKPOST_SECRET'), - ], - - 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), - 'secret' => env('STRIPE_SECRET'), - 'webhook' => [ - 'secret' => env('STRIPE_WEBHOOK_SECRET'), - 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), - ], + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - 'github' => [ - 'token' => env('GITHUB_TOKEN'), - ], - - 'rss' => [ - 'https://freek.dev/feed/originals', - 'https://sebastiandedeyne.com/feed/articles', - 'https://www.stitcher.io/rss', - 'https://alexvanderbist.com/feed', - ], - - 'instagram' => [ - 'token' => env('INSTAGRAM_TOKEN'), - ], - - 'patreon' => [ - 'id' => env('PATREON_CLIENT_ID'), - 'secret' => env('PATREON_SECRET'), - ], ]; diff --git a/phpunit.xml b/phpunit.xml index bb9c4a7e1..d562be801 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ - - ./tests/Feature - - ./tests/Unit + + + ./tests/Feature + @@ -23,9 +23,16 @@ - - - - + + + + + + + + + + + diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e5544d201..f3b01a46f 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -13,7 +13,6 @@ | */ - 'password' => 'Passwords must be at least six 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.', diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index b59ca31d6..e1d879f33 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -18,7 +18,7 @@ 'after' => 'The :attribute must be a date after :date.', 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', 'alpha_num' => 'The :attribute may only contain letters and numbers.', 'array' => 'The :attribute must be an array.', 'before' => 'The :attribute must be a date before :date.', @@ -32,6 +32,7 @@ 'boolean' => 'The :attribute field must be true or false.', 'confirmed' => 'The :attribute confirmation does not match.', 'date' => 'The :attribute is not a valid date.', + 'date_equals' => 'The :attribute must be a date equal to :date.', 'date_format' => 'The :attribute does not match the format :format.', 'different' => 'The :attribute and :other must be different.', 'digits' => 'The :attribute must be :digits digits.', @@ -39,9 +40,22 @@ 'dimensions' => 'The :attribute has invalid image dimensions.', 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', + 'ends_with' => 'The :attribute must end with one of the following: :values', 'exists' => 'The selected :attribute is invalid.', 'file' => 'The :attribute must be a file.', 'filled' => 'The :attribute field must have a value.', + 'gt' => [ + 'numeric' => 'The :attribute must be greater than :value.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', + ], + 'gte' => [ + 'numeric' => 'The :attribute must be greater than or equal :value.', + 'file' => 'The :attribute must be greater than or equal :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal :value characters.', + 'array' => 'The :attribute must have :value items or more.', + ], 'image' => 'The :attribute must be an image.', 'in' => 'The selected :attribute is invalid.', 'in_array' => 'The :attribute field does not exist in :other.', @@ -50,6 +64,18 @@ 'ipv4' => 'The :attribute must be a valid IPv4 address.', 'ipv6' => 'The :attribute must be a valid IPv6 address.', 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ + 'numeric' => 'The :attribute must be less than :value.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', + ], + 'lte' => [ + 'numeric' => 'The :attribute must be less than or equal :value.', + 'file' => 'The :attribute must be less than or equal :value kilobytes.', + 'string' => 'The :attribute must be less than or equal :value characters.', + 'array' => 'The :attribute must not have more than :value items.', + ], 'max' => [ 'numeric' => 'The :attribute may not be greater than :max.', 'file' => 'The :attribute may not be greater than :max kilobytes.', @@ -65,6 +91,7 @@ 'array' => 'The :attribute must have at least :min items.', ], 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', @@ -72,7 +99,7 @@ 'required_if' => 'The :attribute field is required when :other is :value.', 'required_unless' => 'The :attribute field is required unless :other is in :values.', 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values are present.', 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', 'same' => 'The :attribute and :other must match.', @@ -82,11 +109,13 @@ 'string' => 'The :attribute must be :size characters.', 'array' => 'The :attribute must contain :size items.', ], + 'starts_with' => 'The :attribute must start with one of the following: :values', 'string' => 'The :attribute must be a string.', 'timezone' => 'The :attribute must be a valid zone.', 'unique' => 'The :attribute has already been taken.', 'uploaded' => 'The :attribute failed to upload.', 'url' => 'The :attribute format is invalid.', + 'uuid' => 'The :attribute must be a valid UUID.', /* |-------------------------------------------------------------------------- @@ -110,9 +139,9 @@ | Custom Validation Attributes |-------------------------------------------------------------------------- | - | The following language lines are used to swap attribute place-holders - | with something more reader friendly such as E-Mail Address instead - | of "email". This simply helps us make messages a little cleaner. + | The following language lines are used to swap our attribute placeholder + | with something more reader friendly such as "E-Mail Address" instead + | of "email". This simply helps us make our message more expressive. | */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..5041c5a6b --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,29 @@ +make(Kernel::class))->bootstrap(); + +foreach ($commands as $command) { + $console->call($command); +}