From 0ac04a321d078e87f10ab84368801ebb929d0f4f Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Mon, 14 Nov 2022 17:10:47 +0100 Subject: [PATCH] Upgrade to Laravel 9 --- .gitattributes | 12 +++- .gitignore | 2 + .styleci.yml | 2 - app/Exceptions/Handler.php | 9 +++ app/Http/Kernel.php | 8 ++- app/Http/Middleware/TrustHosts.php | 20 ++++++ app/Http/Middleware/ValidateSignature.php | 22 +++++++ artisan | 2 +- composer.json | 18 +++--- config/app.php | 63 +++++++------------ config/auth.php | 4 +- config/broadcasting.php | 10 ++- config/cache.php | 8 +-- config/cors.php | 2 +- config/database.php | 17 +++-- config/filesystems.php | 23 +++---- config/hashing.php | 6 +- config/logging.php | 8 ++- config/mail.php | 4 +- config/queue.php | 2 +- config/services.php | 21 ++----- config/session.php | 16 ++--- package.json | 2 +- public/.htaccess | 4 +- public/index.php | 39 +++--------- resources/lang/en/validation.php | 76 ++++++++++++++--------- 26 files changed, 218 insertions(+), 182 deletions(-) create mode 100644 app/Http/Middleware/TrustHosts.php create mode 100644 app/Http/Middleware/ValidateSignature.php diff --git a/.gitattributes b/.gitattributes index 967315dd..57defee0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,15 @@ * text=auto -*.css linguist-vendored + +*.php diff=php +*.md diff=markdown +*.html diff=html +*.css diff=css linguist-vendored *.scss linguist-vendored *.js linguist-vendored +*.sh linguist-vendored +*.blade.php linguist-vendored +Dockerfile linguist-vendored + +/.github export-ignore CHANGELOG.md export-ignore +.styleci.yml export-ignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 622d8347..d45aa84a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /node_modules +/public/build /public/hot /public/storage /storage/*.key @@ -12,6 +13,7 @@ .phpunit.result.cache Homestead.json Homestead.yaml +auth.json npm-debug.log yarn-error.log _ide_helper.php diff --git a/.styleci.yml b/.styleci.yml index 877ea701..79f63b44 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,12 +1,10 @@ php: preset: laravel - version: 8 disabled: - no_unused_imports finder: not-name: - index.php - - server.php js: finder: not-name: diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3ba01365..cf052a00 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -6,6 +6,15 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler { + /** + * A list of exception types with their corresponding custom log levels. + * + * @var array, \Psr\Log\LogLevel::*> + */ + protected $levels = [ + // + ]; + /** * A list of the exception types that are not reported. * diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 03ffc3b8..a576431b 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,8 +14,10 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ + // \App\Http\Middleware\TrustHosts::class, \App\Http\Middleware\TrustProxies::class, - \Fruitcake\Cors\HandleCors::class, + // \Fruitcake\Cors\HandleCors::class, + \Illuminate\Http\Middleware\HandleCors::class, // \App\Http\Middleware\CheckForMaintenanceMode::class, \App\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, @@ -75,7 +77,9 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'rejectIfDemoMode' => \App\Http\Middleware\RejectIfDemoMode::class, 'rejectIfReverseProxy' => \App\Http\Middleware\RejectIfReverseProxy::class, - + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + // 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, + // 'signed' => \App\Http\Middleware\ValidateSignature::class, ]; /** diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php new file mode 100644 index 00000000..7186414c --- /dev/null +++ b/app/Http/Middleware/TrustHosts.php @@ -0,0 +1,20 @@ + + */ + public function hosts() + { + return [ + $this->allSubdomainsOfApplicationUrl(), + ]; + } +} diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php new file mode 100644 index 00000000..093bf64a --- /dev/null +++ b/app/Http/Middleware/ValidateSignature.php @@ -0,0 +1,22 @@ + + */ + protected $except = [ + // 'fbclid', + // 'utm_campaign', + // 'utm_content', + // 'utm_medium', + // 'utm_source', + // 'utm_term', + ]; +} diff --git a/artisan b/artisan index 5c23e2e2..67a3329b 100644 --- a/artisan +++ b/artisan @@ -11,7 +11,7 @@ define('LARAVEL_START', microtime(true)); | Composer provides a convenient, automatically generated class loader | for our application. We just need to utilize it! We'll require it | into the script here so that we do not have to worry about the -| loading of any our classes "manually". Feels great to relax. +| loading of any of our classes manually. It's great to relax. | */ diff --git a/composer.json b/composer.json index 9991d7e3..4e2c4bf4 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ ], "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.0.2", "ext-bcmath": "*", "ext-ctype": "*", "ext-dom": "*", @@ -23,14 +23,14 @@ "chillerlan/php-qrcode": "^4.3", "darkghosthunter/larapass": "^3.0.2", "doctormckay/steam-totp": "^1.0", - "doctrine/dbal": "^3.3", + "doctrine/dbal": "^3.4", "fruitcake/laravel-cors": "^2.0", "google/protobuf": "^3.21", - "guzzlehttp/guzzle": "^7.0.1", + "guzzlehttp/guzzle": "^7.2", "khanamiryan/qrcode-detector-decoder": "^1.0.5", - "laravel/framework": "^8.0", - "laravel/passport": "^10.0", - "laravel/tinker": "^2.5", + "laravel/framework": "^9.0", + "laravel/passport": "^11.2", + "laravel/tinker": "^2.7", "laravel/ui": "^3.0", "paragonie/constant_time_encoding": "^2.6", "spatie/eloquent-sortable": "^4.0.1", @@ -38,11 +38,11 @@ }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.12", - "facade/ignition": "^2.3.6", + "spatie/laravel-ignition": "^1.0", "fakerphp/faker": "^1.20", "mockery/mockery": "^1.5", - "nunomaduro/collision": "^5.0", - "nunomaduro/larastan": "^1.0", + "nunomaduro/collision": "^6.1", + "nunomaduro/larastan": "^2.0", "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^9.5" }, diff --git a/config/app.php b/config/app.php index ad91f22e..94719955 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,7 @@ 'AES-256-CBC', + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => 'file', + // 'store' => 'redis', + ], + /* |-------------------------------------------------------------------------- | Autoloaded Service Providers @@ -189,50 +209,11 @@ return [ | */ - '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, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'Date' => Illuminate\Support\Facades\Date::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Http' => Illuminate\Support\Facades\Http::class, - 'Js' => Illuminate\Support\Js::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::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, - '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, + 'aliases' => Facade::defaultAliases()->merge([ 'QrCode' => App\Facades\QrCode::class, 'Groups' => App\Facades\Groups::class, 'TwoFAccounts' => App\Facades\TwoFAccounts::class, 'Helpers' => App\Helpers\Helpers::class, - ], + ])->toArray(), ]; diff --git a/config/auth.php b/config/auth.php index 33815fe8..9c8b558f 100644 --- a/config/auth.php +++ b/config/auth.php @@ -46,7 +46,7 @@ return [ | users are actually retrieved out of your database or other storage | mechanisms used by this application to persist your user's data. | - | Supported: "session", "token" + | Supported: "session" | */ @@ -105,7 +105,7 @@ return [ | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. | - | The expire time is the number of minutes that the reset token should be + | The expire time is the number of minutes that each reset token will be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | diff --git a/config/broadcasting.php b/config/broadcasting.php index 48e527e6..9e4d4aa4 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -11,7 +11,7 @@ return [ | framework when an event needs to be broadcast. You may set this to | any of the connections defined in the "connections" array below. | - | Supported: "pusher", "redis", "log", "null" + | Supported: "pusher", "ably", "redis", "log", "null" | */ @@ -36,8 +36,14 @@ return [ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), + 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'port' => env('PUSHER_PORT', 443), + 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, + 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', + ], + 'client_options' => [ + // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html ], ], diff --git a/config/cache.php b/config/cache.php index 8736c7a7..33bb2954 100644 --- a/config/cache.php +++ b/config/cache.php @@ -99,12 +99,12 @@ return [ | Cache Key Prefix |-------------------------------------------------------------------------- | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. + | When utilizing the APC, database, memcached, Redis, or DynamoDB cache + | stores there might be other applications using the same cache. For + | that reason, you may prefix every cache key to avoid collisions. | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), ]; diff --git a/config/cors.php b/config/cors.php index e5f21258..4002f44d 100644 --- a/config/cors.php +++ b/config/cors.php @@ -15,7 +15,7 @@ return [ | */ - 'paths' => ['api/*'], + 'paths' => ['api/*', 'sanctum/csrf-cookie'], 'allowed_methods' => ['*'], 'allowed_origins' => ['*'], 'allowed_origins_patterns' => [], diff --git a/config/database.php b/config/database.php index 0863563a..92a285db 100644 --- a/config/database.php +++ b/config/database.php @@ -81,7 +81,7 @@ return [ 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', + 'search_path' => 'public', 'sslmode' => 'prefer', ], @@ -96,6 +96,8 @@ return [ 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], ], @@ -126,24 +128,27 @@ return [ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'predis'), + 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'predis'), - 'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_', + '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), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), '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), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], diff --git a/config/filesystems.php b/config/filesystems.php index 93909494..8ce2f33f 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -15,19 +15,6 @@ return [ '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 @@ -35,9 +22,9 @@ return [ | | Here you may configure as many filesystem "disks" as you wish, and you | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. + | been set up for each driver as an example of the required values. | - | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" + | Supported Drivers: "local", "ftp", "sftp", "s3" | */ @@ -46,6 +33,7 @@ return [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), + 'throw' => false, ], 'icons' => [ @@ -53,16 +41,19 @@ return [ 'root' => storage_path('app/public/icons'), 'url' => env('APP_URL').'/storage/icons', 'visibility' => 'public', + 'throw' => false, ], 'logos' => [ 'driver' => 'local', 'root' => storage_path('app/logos'), + 'throw' => false, ], 'imagesLink' => [ 'driver' => 'local', 'root' => storage_path('app/imagesLink'), + 'throw' => false, ], 'public' => [ @@ -70,6 +61,7 @@ return [ 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', + 'throw' => false, ], 's3' => [ @@ -81,6 +73,7 @@ return [ 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, ], ], diff --git a/config/hashing.php b/config/hashing.php index 84257708..bcd3be4c 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -44,9 +44,9 @@ return [ */ 'argon' => [ - 'memory' => 1024, - 'threads' => 2, - 'time' => 2, + 'memory' => 65536, + 'threads' => 1, + 'time' => 4, ], ]; diff --git a/config/logging.php b/config/logging.php index 39c2578c..2c4a376f 100644 --- a/config/logging.php +++ b/config/logging.php @@ -30,7 +30,10 @@ return [ | */ - 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => false, + ], /* |-------------------------------------------------------------------------- @@ -78,10 +81,11 @@ return [ 'papertrail' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => SyslogUdpHandler::class, + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), ], ], diff --git a/config/mail.php b/config/mail.php index e8607494..534395a3 100644 --- a/config/mail.php +++ b/config/mail.php @@ -42,7 +42,7 @@ return [ 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, - 'auth_mode' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN'), ], 'ses' => [ @@ -59,7 +59,7 @@ return [ 'sendmail' => [ 'transport' => 'sendmail', - 'path' => '/usr/sbin/sendmail -bs', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), ], 'log' => [ diff --git a/config/queue.php b/config/queue.php index 42a4ad48..25ea5a81 100644 --- a/config/queue.php +++ b/config/queue.php @@ -56,7 +56,7 @@ return [ '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'), + 'queue' => env('SQS_QUEUE', 'default'), 'suffix' => env('SQS_SUFFIX'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'after_commit' => false, diff --git a/config/services.php b/config/services.php index 71cd052b..0ace530e 100644 --- a/config/services.php +++ b/config/services.php @@ -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. | */ @@ -18,6 +18,7 @@ return [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + 'scheme' => 'https', ], 'postmark' => [ @@ -30,18 +31,4 @@ return [ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - // 'sparkpost' => [ - // 'secret' => env('SPARKPOST_SECRET'), - // ], - - // 'stripe' => [ - // 'model' => App\Models\User::class, - // 'key' => env('STRIPE_KEY'), - // 'secret' => env('STRIPE_SECRET'), - // 'webhook' => [ - // 'secret' => env('STRIPE_WEBHOOK_SECRET'), - // 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), - // ], - // ], - ]; diff --git a/config/session.php b/config/session.php index 61c0a296..aa8c851b 100644 --- a/config/session.php +++ b/config/session.php @@ -72,7 +72,7 @@ return [ | */ - 'connection' => env('SESSION_CONNECTION', null), + 'connection' => env('SESSION_CONNECTION'), /* |-------------------------------------------------------------------------- @@ -92,13 +92,15 @@ return [ | Session Cache Store |-------------------------------------------------------------------------- | - | When using the "apc", "memcached", or "dynamodb" session drivers you may + | 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" + | */ - 'store' => env('SESSION_STORE', null), + 'store' => env('SESSION_STORE'), /* |-------------------------------------------------------------------------- @@ -153,7 +155,7 @@ return [ | */ - 'domain' => env('SESSION_DOMAIN', null), + 'domain' => env('SESSION_DOMAIN'), /* |-------------------------------------------------------------------------- @@ -162,7 +164,7 @@ return [ | | By setting this option to true, session cookies will only be sent back | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. + | the cookie from being sent to you when it can't be done securely. | */ @@ -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", "none", null | */ - 'same_site' => null, + 'same_site' => 'lax', ]; diff --git a/package.json b/package.json index bf459edb..6961afc2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/vue-fontawesome": "^2.0.6", - "axios": "^1.0.0", + "axios": "^1.1.0", "bulma": "^0.9.3", "bulma-checkradio": "^2.1.2", "bulma-switch": "^2.0.0", diff --git a/public/.htaccess b/public/.htaccess index b75525be..49cb7586 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -14,8 +14,8 @@ RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] - # Handle Front Controller... + # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] - + \ No newline at end of file diff --git a/public/index.php b/public/index.php index 760b7c82..1d69f3a2 100644 --- a/public/index.php +++ b/public/index.php @@ -3,13 +3,6 @@ use Illuminate\Contracts\Http\Kernel; use Illuminate\Http\Request; -/** - * Laravel - A PHP Framework For Web Artisans - * - * @package Laravel - * @author Taylor Otwell - */ - define('LARAVEL_START', microtime(true)); /* @@ -23,8 +16,8 @@ define('LARAVEL_START', microtime(true)); | */ -if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { - require __DIR__.'/../storage/framework/maintenance.php'; +if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { + require $maintenance; } /* @@ -33,9 +26,8 @@ if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for -| our application. We just need to utilize it! We'll simply require it -| into the script here so that we don't have to worry about manual -| loading any of our classes later on. It feels great to relax. +| this application. We just need to utilize it! We'll simply require it +| into the script here so we don't need to manually load our classes. | */ @@ -43,34 +35,21 @@ require __DIR__.'/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- -| Turn On The Lights +| Run The Application |-------------------------------------------------------------------------- | -| We need to illuminate PHP development, so let us turn on the lights. -| This bootstraps the framework and gets it ready for use, then it -| will load up this application so that we can run it and send -| the responses back to the browser and delight our users. +| Once we have the application, we can handle the incoming request using +| the application's HTTP kernel. Then, we will send the response back +| to this client's browser, allowing them to enjoy our application. | */ $app = require_once __DIR__.'/../bootstrap/app.php'; -/* -|-------------------------------------------------------------------------- -| Run The Application -|-------------------------------------------------------------------------- -| -| Once we have the application, we can handle the incoming request -| through the kernel, and send the associated response back to -| the client's browser allowing them to enjoy the creative -| and wonderful application we have prepared for them. -| -*/ - $kernel = $app->make(Kernel::class); $response = $kernel->handle( $request = Request::capture() )->send(); -$kernel->terminate($request, $response); \ No newline at end of file +$kernel->terminate($request, $response); diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 2f964a64..23651f1f 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -18,17 +18,17 @@ return [ 'active_url' => 'The :attribute is not a valid URL.', '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, dashes and underscores.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'alpha' => 'The :attribute must only contain letters.', + 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', + 'alpha_num' => 'The :attribute must only contain letters and numbers.', 'array' => 'The :attribute must be an array.', 'before' => 'The :attribute must be a date before :date.', 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 'between' => [ - 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', 'array' => 'The :attribute must have between :min and :max items.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'numeric' => 'The :attribute must be between :min and :max.', + 'string' => 'The :attribute must be between :min and :max characters.', ], 'boolean' => 'The :attribute field must be true or false.', 'confirmed' => 'The :attribute confirmation does not match.', @@ -43,22 +43,25 @@ return [ 'digits_between' => 'The :attribute must be between :min and :max digits.', 'dimensions' => 'The :attribute has invalid image dimensions.', 'distinct' => 'The :attribute field has a duplicate value.', + 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.', + 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.', 'email' => 'The :attribute must be a valid email address.', 'ends_with' => 'The :attribute must end with one of the following: :values.', + 'enum' => 'The selected :attribute is invalid.', '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.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'numeric' => 'The :attribute must be greater than :value.', + 'string' => 'The :attribute must be greater than :value characters.', ], '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.', + 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', + 'numeric' => 'The :attribute must be greater than or equal to :value.', + 'string' => 'The :attribute must be greater than or equal to :value characters.', ], 'image' => 'The :attribute must be an image.', 'in' => 'The selected :attribute is invalid.', @@ -69,36 +72,45 @@ return [ '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.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'numeric' => 'The :attribute must be less than :value.', + 'string' => 'The :attribute must be less than :value characters.', ], '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.', + 'file' => 'The :attribute must be less than or equal to :value kilobytes.', + 'numeric' => 'The :attribute must be less than or equal to :value.', + 'string' => 'The :attribute must be less than or equal to :value characters.', ], + 'mac_address' => 'The :attribute must be a valid MAC address.', 'max' => [ - 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', + 'array' => 'The :attribute must not have more than :max items.', + 'file' => 'The :attribute must not be greater than :max kilobytes.', + 'numeric' => 'The :attribute must not be greater than :max.', + 'string' => 'The :attribute must not be greater than :max characters.', ], + 'max_digits' => 'The :attribute must not have more than :max digits.', 'mimes' => 'The :attribute must be a file of type: :values.', 'mimetypes' => 'The :attribute must be a file of type: :values.', 'min' => [ - 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', 'array' => 'The :attribute must have at least :min items.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'numeric' => 'The :attribute must be at least :min.', + 'string' => 'The :attribute must be at least :min characters.', ], + 'min_digits' => 'The :attribute must have at least :min digits.', 'multiple_of' => 'The :attribute must be a multiple of :value.', 'not_in' => 'The selected :attribute is invalid.', 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', - 'password' => 'The password is incorrect.', + 'password' => [ + 'letters' => 'The :attribute must contain at least one letter.', + 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', + 'numbers' => 'The :attribute must contain at least one number.', + 'symbols' => 'The :attribute must contain at least one symbol.', + 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', + ], 'present' => 'The :attribute field must be present.', 'prohibited' => 'The :attribute field is prohibited.', 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', @@ -106,7 +118,9 @@ return [ 'prohibits' => 'The :attribute field prohibits :other from being present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', + 'required_array_keys' => 'The :attribute field must contain entries for: :values.', 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_if_accepted' => 'The :attribute field is required when :other is accepted.', '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 are present.', @@ -114,17 +128,17 @@ return [ 'required_without_all' => 'The :attribute field is required when none of :values are present.', 'same' => 'The :attribute and :other must match.', 'size' => [ - 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', 'array' => 'The :attribute must contain :size items.', + 'file' => 'The :attribute must be :size kilobytes.', + 'numeric' => 'The :attribute must be :size.', + 'string' => 'The :attribute must be :size characters.', ], '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.', + 'timezone' => 'The :attribute must be a valid timezone.', 'unique' => 'The :attribute has already been taken.', 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute must be a valid url.', + 'url' => 'The :attribute must be a valid URL.', 'uuid' => 'The :attribute must be a valid UUID.', 'single' => 'When using :attribute it must be the only parameter in this request body',