From 56a878ec5b8df76ca796a2f5c8d4fc13f11fc307 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:00:58 +0000 Subject: [PATCH 01/15] Apply Laravel coding style Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style). --- app/Http/Controllers/ModController.php | 6 +++--- app/Http/Controllers/ModpackController.php | 6 +++--- app/Models/Modpack.php | 2 +- routes/web.php | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/ModController.php b/app/Http/Controllers/ModController.php index 676f1dc4..c064bdf6 100644 --- a/app/Http/Controllers/ModController.php +++ b/app/Http/Controllers/ModController.php @@ -407,12 +407,12 @@ private function remote_mod_md5($mod, $version, $location) do { $result = UrlUtils::get_remote_md5($URL); - if (!$result['success']) { - Log::warning('Error attempting to remote MD5 file ' . $mod->name . ' version ' . $version . ' located at ' . $URL . '.'); + if (! $result['success']) { + Log::warning('Error attempting to remote MD5 file '.$mod->name.' version '.$version.' located at '.$URL.'.'); } $attempts++; - } while ($attempts < 3 && !$result['success']); + } while ($attempts < 3 && ! $result['success']); return $result; } diff --git a/app/Http/Controllers/ModpackController.php b/app/Http/Controllers/ModpackController.php index f7e733c0..3d8b9927 100644 --- a/app/Http/Controllers/ModpackController.php +++ b/app/Http/Controllers/ModpackController.php @@ -447,9 +447,9 @@ public function anyModify($action = null): JsonResponse } $duplicate = DB::table('build_modversion') - ->where('build_id', '=', $build->id) - ->where('modversion_id', '=', $ver->id) - ->count() > 0; + ->where('build_id', '=', $build->id) + ->where('modversion_id', '=', $ver->id) + ->count() > 0; if ($duplicate) { return response()->json([ 'status' => 'failed', diff --git a/app/Models/Modpack.php b/app/Models/Modpack.php index c74c7380..3cc9e022 100644 --- a/app/Models/Modpack.php +++ b/app/Models/Modpack.php @@ -31,7 +31,7 @@ public function private_builds() return $private; } - public function toApiResponse(Client $client = null, Key $key = null) + public function toApiResponse(?Client $client = null, ?Key $key = null) { $response = [ 'id' => $this->id, diff --git a/routes/web.php b/routes/web.php index 3d015b30..544be5cd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -50,9 +50,9 @@ Route::get('mod/delete/{mod_id}', [ModController::class, 'getDelete'])->name('mod.delete'); Route::post('mod/delete/{mod_id}', [ModController::class, 'postDelete']); Route::post('mod/modify/{mod_id}', [ModController::class, 'postModify']); -// Route::get('mod/rehash', [ModController::class, 'anyRehash'])->name('mod.rehash'); + // Route::get('mod/rehash', [ModController::class, 'anyRehash'])->name('mod.rehash'); Route::post('mod/rehash', [ModController::class, 'anyRehash']); -// Route::get('mod/add-version', [ModController::class, 'anyAddVersion'])->name('mod.addVersion'); + // Route::get('mod/add-version', [ModController::class, 'anyAddVersion'])->name('mod.addVersion'); Route::post('mod/add-version', [ModController::class, 'anyAddVersion']); Route::post('mod/delete-version/{version_id}', [ModController::class, 'anyDeleteVersion']); Route::get('mod/versions/{modSlug}', [ModController::class, 'getModVersions']); @@ -70,7 +70,7 @@ Route::post('modpack/edit/{modpack_id}', [ModpackController::class, 'postEdit']); Route::get('modpack/delete/{modpack_id}', [ModpackController::class, 'getDelete'])->name('modpack.delete'); Route::post('modpack/delete/{modpack_id}', [ModpackController::class, 'postDelete']); -// Route::get('modpack/modify/{action}', [ModpackController::class, 'anyModify'])->name('modpack.modify'); + // Route::get('modpack/modify/{action}', [ModpackController::class, 'anyModify'])->name('modpack.modify'); Route::post('modpack/modify/{action}', [ModpackController::class, 'anyModify']); Route::get('solder/configure', [SolderController::class, 'getConfigure'])->name('solder.configure'); From 7627e45061ca0cb325a28df05de0ca7e83c647b1 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:13 +0000 Subject: [PATCH 02/15] Remove default `app` files --- app/Console/Kernel.php | 28 ----------- app/Exceptions/Handler.php | 48 ------------------- app/Http/Middleware/Authenticate.php | 17 ------- app/Http/Middleware/EncryptCookies.php | 17 ------- .../PreventRequestsDuringMaintenance.php | 17 ------- .../Middleware/RedirectIfAuthenticated.php | 30 ------------ app/Http/Middleware/TrimStrings.php | 19 -------- app/Http/Middleware/TrustHosts.php | 20 -------- app/Http/Middleware/TrustProxies.php | 28 ----------- app/Http/Middleware/ValidateSignature.php | 22 --------- app/Http/Middleware/VerifyCsrfToken.php | 17 ------- app/Providers/AuthServiceProvider.php | 25 ---------- app/Providers/BroadcastServiceProvider.php | 19 -------- app/Providers/EventServiceProvider.php | 38 --------------- app/Providers/RouteServiceProvider.php | 48 ------------------- 15 files changed, 393 deletions(-) delete mode 100644 app/Console/Kernel.php delete mode 100644 app/Exceptions/Handler.php delete mode 100644 app/Http/Middleware/Authenticate.php delete mode 100644 app/Http/Middleware/EncryptCookies.php delete mode 100644 app/Http/Middleware/PreventRequestsDuringMaintenance.php delete mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php delete mode 100644 app/Http/Middleware/TrimStrings.php delete mode 100644 app/Http/Middleware/TrustHosts.php delete mode 100644 app/Http/Middleware/TrustProxies.php delete mode 100644 app/Http/Middleware/ValidateSignature.php delete mode 100644 app/Http/Middleware/VerifyCsrfToken.php delete mode 100644 app/Providers/AuthServiceProvider.php delete mode 100644 app/Providers/BroadcastServiceProvider.php delete mode 100644 app/Providers/EventServiceProvider.php delete mode 100644 app/Providers/RouteServiceProvider.php diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php deleted file mode 100644 index 4798a7e9..00000000 --- a/app/Console/Kernel.php +++ /dev/null @@ -1,28 +0,0 @@ -command('inspire') - // ->hourly(); - } - - /** - * Register the commands for the application. - */ - protected function commands(): void - { - $this->load(__DIR__.'/Commands'); - - require base_path('routes/console.php'); - } -} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php deleted file mode 100644 index b1c262c6..00000000 --- a/app/Exceptions/Handler.php +++ /dev/null @@ -1,48 +0,0 @@ -, \Psr\Log\LogLevel::*> - */ - protected $levels = [ - // - ]; - - /** - * A list of the exception types that are not reported. - * - * @var array> - */ - protected $dontReport = [ - // - ]; - - /** - * A list of the inputs that are never flashed to the session on validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'current_password', - 'password', - 'password_confirmation', - ]; - - /** - * Register the exception handling callbacks for the application. - */ - public function register(): void - { - $this->reportable(function (Throwable $e) { - // - }); - } -} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php deleted file mode 100644 index d4ef6447..00000000 --- a/app/Http/Middleware/Authenticate.php +++ /dev/null @@ -1,17 +0,0 @@ -expectsJson() ? null : route('login'); - } -} diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php deleted file mode 100644 index 033136ad..00000000 --- a/app/Http/Middleware/EncryptCookies.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - protected $except = [ - // - ]; -} diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php deleted file mode 100644 index 4b2af74d..00000000 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ /dev/null @@ -1,30 +0,0 @@ -check()) { - return redirect(RouteServiceProvider::HOME); - } - } - - return $next($request); - } -} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php deleted file mode 100644 index 88cadcaa..00000000 --- a/app/Http/Middleware/TrimStrings.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ - protected $except = [ - 'current_password', - 'password', - 'password_confirmation', - ]; -} diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php deleted file mode 100644 index c9c58bdd..00000000 --- a/app/Http/Middleware/TrustHosts.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function hosts(): array - { - return [ - $this->allSubdomainsOfApplicationUrl(), - ]; - } -} diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php deleted file mode 100644 index 3391630e..00000000 --- a/app/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,28 +0,0 @@ -|string|null - */ - protected $proxies; - - /** - * The headers that should be used to detect proxies. - * - * @var int - */ - protected $headers = - Request::HEADER_X_FORWARDED_FOR | - Request::HEADER_X_FORWARDED_HOST | - Request::HEADER_X_FORWARDED_PORT | - Request::HEADER_X_FORWARDED_PROTO | - Request::HEADER_X_FORWARDED_AWS_ELB; -} diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php deleted file mode 100644 index 093bf64a..00000000 --- a/app/Http/Middleware/ValidateSignature.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ - protected $except = [ - // 'fbclid', - // 'utm_campaign', - // 'utm_content', - // 'utm_medium', - // 'utm_source', - // 'utm_term', - ]; -} diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php deleted file mode 100644 index 0c13b854..00000000 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ /dev/null @@ -1,17 +0,0 @@ - 'App\Policies\ModelPolicy', - ]; - - /** - * Register any authentication / authorization services. - */ - public function boot(): void - { - // - } -} diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php deleted file mode 100644 index 2be04f5d..00000000 --- a/app/Providers/BroadcastServiceProvider.php +++ /dev/null @@ -1,19 +0,0 @@ - [ - SendEmailVerificationNotification::class, - ], - ]; - - /** - * Register any events for your application. - */ - public function boot(): void - { - - // - } - - /** - * Determine if events and listeners should be automatically discovered. - */ - public function shouldDiscoverEvents(): bool - { - return false; - } -} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php deleted file mode 100644 index bc491099..00000000 --- a/app/Providers/RouteServiceProvider.php +++ /dev/null @@ -1,48 +0,0 @@ -configureRateLimiting(); - - $this->routes(function () { - Route::middleware('api') - ->prefix('api') - ->group(base_path('routes/api.php')); - - Route::middleware('web') - ->group(base_path('routes/web.php')); - }); - } - - /** - * Configure the rate limiters for the application. - */ - protected function configureRateLimiting(): void - { - RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); - }); - } -} From 4fcc67ff944cbc31b7f7f6d78491a28c007b44b9 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:15 +0000 Subject: [PATCH 03/15] Shift core files --- app/Http/Kernel.php | 1 + artisan | 50 ++++++--------------------------------------- public/index.php | 48 +++++-------------------------------------- 3 files changed, 12 insertions(+), 87 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 1a732426..e0bf8aaf 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -86,6 +86,7 @@ class Kernel extends HttpKernel 'can' => Authorize::class, 'guest' => RedirectIfAuthenticated::class, 'password.confirm' => RequirePassword::class, + 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 'signed' => ValidateSignature::class, 'throttle' => ThrottleRequests::class, 'verified' => EnsureEmailIsVerified::class, diff --git a/artisan b/artisan index 5c23e2e2..8e04b422 100644 --- a/artisan +++ b/artisan @@ -1,53 +1,15 @@ #!/usr/bin/env php make(Illuminate\Contracts\Console\Kernel::class); - -$status = $kernel->handle( - $input = new Symfony\Component\Console\Input\ArgvInput, - new Symfony\Component\Console\Output\ConsoleOutput -); - -/* -|-------------------------------------------------------------------------- -| Shutdown The Application -|-------------------------------------------------------------------------- -| -| Once Artisan has finished running, we will fire off the shutdown events -| so that any final work may be done by the application before we shut -| down the process. This is the last thing to happen to the request. -| -*/ - -$kernel->terminate($input, $status); +// Bootstrap Laravel and handle the command... +$status = (require_once __DIR__.'/bootstrap/app.php') + ->handleCommand(new ArgvInput); exit($status); diff --git a/public/index.php b/public/index.php index 1d69f3a2..947d9896 100644 --- a/public/index.php +++ b/public/index.php @@ -1,55 +1,17 @@ make(Kernel::class); - -$response = $kernel->handle( - $request = Request::capture() -)->send(); - -$kernel->terminate($request, $response); +// Bootstrap Laravel and handle the request... +(require_once __DIR__.'/../bootstrap/app.php') + ->handleRequest(Request::capture()); From 647b6e3ff661eba15b9806cf5e7fde3349d1ef30 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:23 +0000 Subject: [PATCH 04/15] Streamline config files --- config/.gitkeep | 0 config/app.php | 190 +------------------------------------ config/auth.php | 115 ----------------------- config/broadcasting.php | 70 -------------- config/cache.php | 110 ---------------------- config/cors.php | 34 ------- config/database.php | 147 +---------------------------- config/filesystems.php | 76 --------------- config/hashing.php | 52 ----------- config/logging.php | 122 ------------------------ config/mail.php | 110 ---------------------- config/queue.php | 93 ------------------- config/services.php | 22 ----- config/session.php | 201 ---------------------------------------- config/view.php | 36 ------- 15 files changed, 6 insertions(+), 1372 deletions(-) create mode 100644 config/.gitkeep delete mode 100644 config/auth.php delete mode 100644 config/broadcasting.php delete mode 100644 config/cache.php delete mode 100644 config/cors.php delete mode 100644 config/filesystems.php delete mode 100644 config/hashing.php delete mode 100644 config/logging.php delete mode 100644 config/queue.php delete mode 100644 config/session.php delete mode 100644 config/view.php diff --git a/config/.gitkeep b/config/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/config/app.php b/config/app.php index ca6a41b0..6e062d0f 100644 --- a/config/app.php +++ b/config/app.php @@ -1,186 +1,14 @@ env('APP_NAME', 'Laravel'), - - /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | - */ - - 'env' => env('APP_ENV', 'production'), - - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ - - 'debug' => (bool) env('APP_DEBUG', false), - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => env('APP_URL', 'http://localhost'), - - 'asset_url' => env('ASSET_URL', null), - - /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | - */ - - 'timezone' => 'UTC', - - /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | - */ - - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | - */ - - 'fallback_locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | - */ - - 'faker_locale' => 'en_US', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => env('APP_KEY'), - - 'cipher' => '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 - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | - */ - - 'providers' => [ - + 'providers' => ServiceProvider::defaultProviders()->merge([ /* * Laravel Framework Service Providers... */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - Illuminate\Translation\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, /* * Package Service Providers... @@ -195,19 +23,7 @@ // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, - - ], - - /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | - */ + ])->toArray(), 'aliases' => Facade::defaultAliases()->merge([ 'Form' => Collective\Html\FormFacade::class, diff --git a/config/auth.php b/config/auth.php deleted file mode 100644 index d83996ad..00000000 --- a/config/auth.php +++ /dev/null @@ -1,115 +0,0 @@ - [ - 'guard' => 'web', - 'passwords' => 'users', - ], - - /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session" - | - */ - - 'guards' => [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], - ], - - /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | - */ - - 'providers' => [ - 'users' => [ - 'driver' => 'eloquent', - 'model' => App\Models\User::class, - ], - - // 'users' => [ - // 'driver' => 'database', - // 'table' => 'users', - // ], - ], - - /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | 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 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. - | - | The throttle setting is the number of seconds a user must wait before - | generating more password reset tokens. This prevents the user from - | quickly generating a very large amount of password reset tokens. - | - */ - - 'passwords' => [ - 'users' => [ - '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, - -]; diff --git a/config/broadcasting.php b/config/broadcasting.php deleted file mode 100644 index 9e4d4aa4..00000000 --- a/config/broadcasting.php +++ /dev/null @@ -1,70 +0,0 @@ - env('BROADCAST_DRIVER', 'null'), - - /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | - */ - - 'connections' => [ - - 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), - 'options' => [ - '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 - ], - ], - - 'ably' => [ - 'driver' => 'ably', - 'key' => env('ABLY_KEY'), - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - ], - - 'log' => [ - 'driver' => 'log', - ], - - 'null' => [ - 'driver' => 'null', - ], - - ], - -]; diff --git a/config/cache.php b/config/cache.php deleted file mode 100644 index 33bb2954..00000000 --- a/config/cache.php +++ /dev/null @@ -1,110 +0,0 @@ - env('CACHE_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | - | Supported drivers: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb", "octane", "null" - | - */ - - 'stores' => [ - - 'apc' => [ - 'driver' => 'apc', - ], - - 'array' => [ - 'driver' => 'array', - 'serialize' => false, - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - 'lock_connection' => null, - ], - - 'file' => [ - 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), - ], - - 'memcached' => [ - 'driver' => 'memcached', - 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ - env('MEMCACHED_USERNAME'), - env('MEMCACHED_PASSWORD'), - ], - 'options' => [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, - ], - 'servers' => [ - [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), - 'weight' => 100, - ], - ], - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'cache', - 'lock_connection' => 'default', - ], - - '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'), - 'endpoint' => env('DYNAMODB_ENDPOINT'), - ], - - 'octane' => [ - 'driver' => 'octane', - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | 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_'), - -]; diff --git a/config/cors.php b/config/cors.php deleted file mode 100644 index 8a39e6da..00000000 --- a/config/cors.php +++ /dev/null @@ -1,34 +0,0 @@ - ['api/*', 'sanctum/csrf-cookie'], - - 'allowed_methods' => ['*'], - - 'allowed_origins' => ['*'], - - 'allowed_origins_patterns' => [], - - 'allowed_headers' => ['*'], - - 'exposed_headers' => [], - - 'max_age' => 0, - - 'supports_credentials' => false, - -]; diff --git a/config/database.php b/config/database.php index 137ad18c..1fc80662 100644 --- a/config/database.php +++ b/config/database.php @@ -1,151 +1,10 @@ env('DB_CONNECTION', 'mysql'), - - /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | - */ - - 'connections' => [ - - 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', - 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), - ], - - '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'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - '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'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - 'search_path' => 'public', - 'sslmode' => 'prefer', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'prefix_indexes' => true, - // 'encrypt' => env('DB_ENCRYPT', 'yes'), - // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | - */ - - 'migrations' => 'migrations', - - /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | - */ - - 'redis' => [ - - 'client' => env('REDIS_CLIENT', 'phpredis'), - - 'options' => [ - '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'), - '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'), - 'username' => env('REDIS_USERNAME'), - 'password' => env('REDIS_PASSWORD'), - 'port' => env('REDIS_PORT', '6379'), - 'database' => env('REDIS_CACHE_DB', '1'), - ], - + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => false, // disable to preserve original behavior for existing applications ], ]; diff --git a/config/filesystems.php b/config/filesystems.php deleted file mode 100644 index e9d9dbdb..00000000 --- a/config/filesystems.php +++ /dev/null @@ -1,76 +0,0 @@ - env('FILESYSTEM_DISK', 'local'), - - /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | 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 set up for each driver as an example of the required values. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | - */ - - 'disks' => [ - - 'local' => [ - 'driver' => 'local', - 'root' => storage_path('app'), - 'throw' => false, - ], - - 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', - 'visibility' => 'public', - 'throw' => false, - ], - - 's3' => [ - 'driver' => 's3', - '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'), - 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), - 'throw' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | 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'), - ], - -]; diff --git a/config/hashing.php b/config/hashing.php deleted file mode 100644 index bcd3be4c..00000000 --- a/config/hashing.php +++ /dev/null @@ -1,52 +0,0 @@ - 'bcrypt', - - /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], - - /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | - */ - - 'argon' => [ - 'memory' => 65536, - 'threads' => 1, - 'time' => 4, - ], - -]; diff --git a/config/logging.php b/config/logging.php deleted file mode 100644 index 5aa1dbb7..00000000 --- a/config/logging.php +++ /dev/null @@ -1,122 +0,0 @@ - env('LOG_CHANNEL', 'stack'), - - /* - |-------------------------------------------------------------------------- - | Deprecations Log Channel - |-------------------------------------------------------------------------- - | - | This option controls the log channel that should be used to log warnings - | regarding deprecated PHP and library features. This allows you to get - | your application ready for upcoming major versions of dependencies. - | - */ - - 'deprecations' => [ - 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), - 'trace' => false, - ], - - /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | - */ - - 'channels' => [ - 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], - 'ignore_exceptions' => false, - ], - - 'single' => [ - 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'daily' => [ - 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 14, - ], - - 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => env('LOG_LEVEL', 'critical'), - ], - - 'papertrail' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - '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'), - ], - ], - - 'stderr' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => StreamHandler::class, - 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ - 'stream' => 'php://stderr', - ], - ], - - 'syslog' => [ - 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'errorlog' => [ - 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), - ], - - 'null' => [ - 'driver' => 'monolog', - 'handler' => NullHandler::class, - ], - - 'emergency' => [ - 'path' => storage_path('logs/laravel.log'), - ], - ], - -]; diff --git a/config/mail.php b/config/mail.php index 049052ff..77815a61 100644 --- a/config/mail.php +++ b/config/mail.php @@ -2,123 +2,13 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Mailer - |-------------------------------------------------------------------------- - | - | 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. - | - */ - - '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", "failover" - | - */ - '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, - 'local_domain' => env('MAIL_EHLO_DOMAIN'), - ], - - 'ses' => [ - 'transport' => 'ses', - ], - 'mailgun' => [ 'transport' => 'mailgun', // 'client' => [ // 'timeout' => 5, // ], ], - - 'postmark' => [ - 'transport' => 'postmark', - // 'client' => [ - // 'timeout' => 5, - // ], - ], - - 'sendmail' => [ - 'transport' => 'sendmail', - 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), - ], - - 'log' => [ - 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), - ], - - 'array' => [ - 'transport' => 'array', - ], - - 'failover' => [ - 'transport' => 'failover', - 'mailers' => [ - 'smtp', - 'log', - ], - ], - ], - - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | 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'), - ], - - /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | - */ - - 'markdown' => [ - 'theme' => 'default', - - 'paths' => [ - resource_path('views/vendor/mail'), - ], ], ]; diff --git a/config/queue.php b/config/queue.php deleted file mode 100644 index 25ea5a81..00000000 --- a/config/queue.php +++ /dev/null @@ -1,93 +0,0 @@ - env('QUEUE_CONNECTION', 'sync'), - - /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | - */ - - 'connections' => [ - - 'sync' => [ - 'driver' => 'sync', - ], - - 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, - 'after_commit' => false, - ], - - 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => 0, - 'after_commit' => false, - ], - - 'sqs' => [ - 'driver' => 'sqs', - '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', 'default'), - 'suffix' => env('SQS_SUFFIX'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'after_commit' => false, - ], - - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, - 'block_for' => null, - 'after_commit' => false, - ], - - ], - - /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | - */ - - 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', - ], - -]; diff --git a/config/services.php b/config/services.php index 0ace530e..62e0a08a 100644 --- a/config/services.php +++ b/config/services.php @@ -2,18 +2,6 @@ return [ - /* - |-------------------------------------------------------------------------- - | Third Party Services - |-------------------------------------------------------------------------- - | - | This file is for storing the credentials for third party services such - | 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. - | - */ - 'mailgun' => [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), @@ -21,14 +9,4 @@ 'scheme' => 'https', ], - 'postmark' => [ - 'token' => env('POSTMARK_TOKEN'), - ], - - 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - ], - ]; diff --git a/config/session.php b/config/session.php deleted file mode 100644 index 8fed97c0..00000000 --- a/config/session.php +++ /dev/null @@ -1,201 +0,0 @@ - env('SESSION_DRIVER', 'file'), - - /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | - */ - - 'lifetime' => env('SESSION_LIFETIME', 120), - - 'expire_on_close' => false, - - /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | - */ - - 'encrypt' => false, - - /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | - */ - - 'files' => storage_path('framework/sessions'), - - /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | - */ - - 'connection' => env('SESSION_CONNECTION'), - - /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | - */ - - 'table' => 'sessions', - - /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | 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'), - - /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | - */ - - 'lottery' => [2, 100], - - /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | - */ - - 'cookie' => env( - 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' - ), - - /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | - */ - - 'path' => '/', - - /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | - */ - - 'domain' => env('SESSION_DOMAIN'), - - /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | 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 when it can't be done securely. - | - */ - - 'secure' => env('SESSION_SECURE_COOKIE'), - - /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | - */ - - 'http_only' => true, - - /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | will set this value to "lax" since this is a secure default value. - | - | Supported: "lax", "strict", "none", null - | - */ - - 'same_site' => 'lax', - -]; diff --git a/config/view.php b/config/view.php deleted file mode 100644 index 22b8a18d..00000000 --- a/config/view.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - resource_path('views'), - ], - - /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | - */ - - 'compiled' => env( - 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) - ), - -]; From 53bdaa17c8797b9f432f1c6fe378f922b099d029 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:25 +0000 Subject: [PATCH 05/15] Set new `ENV` variables --- .env.example | 18 ++++++++++++++++-- docker/.env | 4 ++-- phpunit.xml | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index d56ebcf3..66910aaf 100644 --- a/.env.example +++ b/.env.example @@ -2,9 +2,20 @@ APP_NAME="Technic Solder" APP_ENV=production APP_KEY= APP_DEBUG=false +APP_TIMEZONE=UTC APP_URL=http://localhost +APP_LOCALE=en +APP_FALLBACK_LOCALE=en +APP_FAKER_LOCALE=en_US + +APP_MAINTENANCE_DRIVER=file +APP_MAINTENANCE_STORE=database + +BCRYPT_ROUNDS=12 + LOG_CHANNEL=stack +LOG_STACK=single DB_CONNECTION=mysql DB_HOST=127.0.0.1 @@ -13,11 +24,14 @@ DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD= -BROADCAST_DRIVER=log -CACHE_DRIVER=file +BROADCAST_CONNECTION=log +CACHE_STORE=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null diff --git a/docker/.env b/docker/.env index 408c5f01..15a5cc0f 100644 --- a/docker/.env +++ b/docker/.env @@ -13,8 +13,8 @@ DB_DATABASE=solder DB_USERNAME=solder DB_PASSWORD=solder -BROADCAST_DRIVER=log -CACHE_DRIVER=redis +BROADCAST_CONNECTION=log +CACHE_STORE=redis QUEUE_CONNECTION=redis SESSION_DRIVER=redis SESSION_LIFETIME=120 diff --git a/phpunit.xml b/phpunit.xml index cfa9c5bc..b4de1013 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -16,7 +16,7 @@ - + From b7b20640cf4dbea3b9894c68165258f5bf3f6d8e Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:25 +0000 Subject: [PATCH 06/15] Default new `bootstrap/app.php` --- bootstrap/app.php | 72 +++++++++++------------------------------ bootstrap/providers.php | 5 +++ 2 files changed, 24 insertions(+), 53 deletions(-) create mode 100644 bootstrap/providers.php diff --git a/bootstrap/app.php b/bootstrap/app.php index 037e17df..d5d7e70d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,55 +1,21 @@ singleton( - Illuminate\Contracts\Http\Kernel::class, - App\Http\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Console\Kernel::class, - App\Console\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - App\Exceptions\Handler::class -); - -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ - -return $app; +use Illuminate\Foundation\Application; +use Illuminate\Foundation\Configuration\Exceptions; +use Illuminate\Foundation\Configuration\Middleware; + +return Application::configure(basePath: dirname(__DIR__)) + ->withProviders() + ->withRouting( + web: __DIR__.'/../routes/web.php', + // api: __DIR__.'/../routes/api.php', + commands: __DIR__.'/../routes/console.php', + // channels: __DIR__.'/../routes/channels.php', + health: '/up', + ) + ->withMiddleware(function (Middleware $middleware) { + // + }) + ->withExceptions(function (Exceptions $exceptions) { + // + })->create(); diff --git a/bootstrap/providers.php b/bootstrap/providers.php new file mode 100644 index 00000000..38b258d1 --- /dev/null +++ b/bootstrap/providers.php @@ -0,0 +1,5 @@ + Date: Mon, 18 Mar 2024 00:01:25 +0000 Subject: [PATCH 07/15] Re-register HTTP middleware --- app/Http/Kernel.php | 121 -------------------------------------------- bootstrap/app.php | 27 +++++++++- 2 files changed, 26 insertions(+), 122 deletions(-) delete mode 100644 app/Http/Kernel.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php deleted file mode 100644 index e0bf8aaf..00000000 --- a/app/Http/Kernel.php +++ /dev/null @@ -1,121 +0,0 @@ - [ - EncryptCookies::class, - AddQueuedCookiesToResponse::class, - StartSession::class, - // \Illuminate\Session\Middleware\AuthenticateSession::class, - ShareErrorsFromSession::class, - //\App\Http\Middleware\VerifyCsrfToken::class, TODO - SubstituteBindings::class, - ], - - 'api' => [ - \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', - SubstituteBindings::class, - Cors::class, - ], - ]; - - /** - * The application's middleware aliases. - * - * Aliases may be used to conveniently assign middleware to routes and groups. - * - * @var array - */ - protected $middlewareAliases = [ - 'auth' => Authenticate::class, - 'auth.basic' => AuthenticateWithBasicAuth::class, - 'cache.headers' => SetCacheHeaders::class, - 'can' => Authorize::class, - 'guest' => RedirectIfAuthenticated::class, - 'password.confirm' => RequirePassword::class, - 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, - 'signed' => ValidateSignature::class, - 'throttle' => ThrottleRequests::class, - 'verified' => EnsureEmailIsVerified::class, - - // Solder middleware - 'build' => Build::class, - 'cors' => Cors::class, - 'modpack' => Modpack::class, - 'solder_clients' => SolderClients::class, - 'solder_keys' => SolderKeys::class, - 'solder_modpacks' => SolderModpacks::class, - 'solder_mods' => SolderMods::class, - 'solder_users' => SolderUsers::class, - ]; - - /** - * The priority-sorted list of middleware. - * - * This forces non-global middleware to always be in the given order. - * - * @var array - */ - protected $middlewarePriority = [ - StartSession::class, - ShareErrorsFromSession::class, - Authenticate::class, - ThrottleRequests::class, - AuthenticateSession::class, - SubstituteBindings::class, - Authorize::class, - ]; -} diff --git a/bootstrap/app.php b/bootstrap/app.php index d5d7e70d..d39dfc1d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -14,7 +14,32 @@ health: '/up', ) ->withMiddleware(function (Middleware $middleware) { - // + $middleware->redirectGuestsTo(fn () => route('login')); + $middleware->redirectUsersTo(RouteServiceProvider::HOME); + + $middleware->throttleApi(); + $middleware->api(\App\Http\Middleware\Cors::class); + + $middleware->alias([ + 'build' => \App\Http\Middleware\Build::class, + 'cors' => \App\Http\Middleware\Cors::class, + 'modpack' => \App\Http\Middleware\Modpack::class, + 'solder_clients' => \App\Http\Middleware\SolderClients::class, + 'solder_keys' => \App\Http\Middleware\SolderKeys::class, + 'solder_modpacks' => \App\Http\Middleware\SolderModpacks::class, + 'solder_mods' => \App\Http\Middleware\SolderMods::class, + 'solder_users' => \App\Http\Middleware\SolderUsers::class, + ]); + + $middleware->priority([ + StartSession::class, + ShareErrorsFromSession::class, + Authenticate::class, + ThrottleRequests::class, + AuthenticateSession::class, + SubstituteBindings::class, + Authorize::class, + ]); }) ->withExceptions(function (Exceptions $exceptions) { // From cb221463d0a5ee26b2fc0b30e665550320c37447 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:26 +0000 Subject: [PATCH 08/15] Consolidate service providers --- app/Providers/AppServiceProvider.php | 9 +++++++++ bootstrap/app.php | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ab1f8ce4..ced27d63 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -9,6 +9,15 @@ class AppServiceProvider extends ServiceProvider { + /** + * The path to your application's "home" route. + * + * Typically, users are redirected here after authentication. + * + * @var string + */ + public const HOME = '/home'; + /** * Register any application services. */ diff --git a/bootstrap/app.php b/bootstrap/app.php index d39dfc1d..2446efa8 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,5 +1,6 @@ withMiddleware(function (Middleware $middleware) { $middleware->redirectGuestsTo(fn () => route('login')); - $middleware->redirectUsersTo(RouteServiceProvider::HOME); + $middleware->redirectUsersTo(AppServiceProvider::HOME); $middleware->throttleApi(); $middleware->api(\App\Http\Middleware\Cors::class); From 2d42634c5b3a8d1c00057211727092cf82701943 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:26 +0000 Subject: [PATCH 09/15] Re-register service providers --- bootstrap/app.php | 4 +++- config/app.php | 19 ------------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 2446efa8..b29ba17a 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -6,7 +6,9 @@ use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) - ->withProviders() + ->withProviders([ + \Collective\Html\HtmlServiceProvider::class, + ]) ->withRouting( web: __DIR__.'/../routes/web.php', // api: __DIR__.'/../routes/api.php', diff --git a/config/app.php b/config/app.php index 6e062d0f..a1b1ab42 100644 --- a/config/app.php +++ b/config/app.php @@ -5,25 +5,6 @@ return [ - 'providers' => ServiceProvider::defaultProviders()->merge([ - /* - * Laravel Framework Service Providers... - */ - - /* - * Package Service Providers... - */ - Collective\Html\HtmlServiceProvider::class, - - /* - * Application Service Providers... - */ - App\Providers\AppServiceProvider::class, - App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\RouteServiceProvider::class, - ])->toArray(), 'aliases' => Facade::defaultAliases()->merge([ 'Form' => Collective\Html\FormFacade::class, From 1762872492d19eeedb96c83d39a4dab07c175df8 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:30 +0000 Subject: [PATCH 10/15] Re-register routes --- bootstrap/app.php | 2 +- routes/channels.php | 16 ---------------- routes/console.php | 13 +------------ 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 routes/channels.php diff --git a/bootstrap/app.php b/bootstrap/app.php index b29ba17a..e027ce2d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -11,7 +11,7 @@ ]) ->withRouting( web: __DIR__.'/../routes/web.php', - // api: __DIR__.'/../routes/api.php', + api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', // channels: __DIR__.'/../routes/channels.php', health: '/up', diff --git a/routes/channels.php b/routes/channels.php deleted file mode 100644 index f16a20b9..00000000 --- a/routes/channels.php +++ /dev/null @@ -1,16 +0,0 @@ -id === (int) $id; -}); diff --git a/routes/console.php b/routes/console.php index e05f4c9a..eff2ed24 100644 --- a/routes/console.php +++ b/routes/console.php @@ -3,17 +3,6 @@ use Illuminate\Foundation\Inspiring; use Illuminate\Support\Facades\Artisan; -/* -|-------------------------------------------------------------------------- -| Console Routes -|-------------------------------------------------------------------------- -| -| This file is where you may define all of your Closure based console -| commands. Each Closure is bound to a command instance allowing a -| simple approach to interacting with each command's IO methods. -| -*/ - Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); -})->purpose('Display an inspiring quote'); +})->purpose('Display an inspiring quote')->hourly(); From a954f3286879f6035899b5835fc1e17a1c2ed0c7 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:30 +0000 Subject: [PATCH 11/15] Bump Composer dependencies --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 86ad616c..9a4dbf6f 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-curl": "*", "ext-json": "*", "ext-pdo": "*", @@ -40,17 +40,17 @@ "http-interop/http-factory-guzzle": "^1.2", "intervention/image": "^2.7.2", "knplabs/github-api": "^3.12", - "laravel/framework": "^10.28", - "laravel/tinker": "^2.8.2", + "laravel/framework": "^11.0", + "laravel/tinker": "^2.9", "laravelcollective/html": "^6.4.1" }, "require-dev": { - "barryvdh/laravel-debugbar": "^3.9.2", + "barryvdh/laravel-debugbar": "^3.10", "mockery/mockery": "^1.6.6", "nunomaduro/collision": "^6.4", "phpunit/phpunit": "^9.6.13", "fakerphp/faker": "^1.23.0", - "spatie/laravel-ignition": "^2.3.1" + "spatie/laravel-ignition": "^2.4" }, "config": { "optimize-autoloader": true, @@ -77,7 +77,7 @@ "Tests\\": "tests/" } }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "scripts": { "post-autoload-dump": [ From 5a0e6e2a213ce94b0c955a17fa4bda1ea62c0c83 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:36 +0000 Subject: [PATCH 12/15] Adopt Laravel type hints --- app/Models/Build.php | 6 ++++-- app/Models/Client.php | 3 ++- app/Models/Mod.php | 3 ++- app/Models/Modpack.php | 6 ++++-- app/Models/Modversion.php | 6 ++++-- app/Models/User.php | 5 +++-- app/Models/UserPermission.php | 3 ++- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/Models/Build.php b/app/Models/Build.php index decd0269..4e195e6d 100644 --- a/app/Models/Build.php +++ b/app/Models/Build.php @@ -2,18 +2,20 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Build extends Model { protected $guarded = []; - public function modpack() + public function modpack(): BelongsTo { return $this->belongsTo(Modpack::class); } - public function modversions() + public function modversions(): BelongsToMany { return $this->belongsToMany(Modversion::class)->withTimestamps(); } diff --git a/app/Models/Client.php b/app/Models/Client.php index 858ec23f..d77ea402 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -2,13 +2,14 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Client extends Model { protected $guarded = []; - public function modpacks() + public function modpacks(): BelongsToMany { return $this->belongsToMany(Modpack::class)->withTimestamps(); } diff --git a/app/Models/Mod.php b/app/Models/Mod.php index 016005f7..d652cba2 100644 --- a/app/Models/Mod.php +++ b/app/Models/Mod.php @@ -2,13 +2,14 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; class Mod extends Model { protected $guarded = []; - public function versions() + public function versions(): HasMany { return $this->hasMany(Modversion::class); } diff --git a/app/Models/Modpack.php b/app/Models/Modpack.php index 3cc9e022..96f86a3e 100644 --- a/app/Models/Modpack.php +++ b/app/Models/Modpack.php @@ -2,18 +2,20 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Modpack extends Model { protected $guarded = []; - public function builds() + public function builds(): HasMany { return $this->hasMany(Build::class); } - public function clients() + public function clients(): BelongsToMany { return $this->belongsToMany(Client::class)->withTimestamps(); } diff --git a/app/Models/Modversion.php b/app/Models/Modversion.php index 5b632594..60229a19 100644 --- a/app/Models/Modversion.php +++ b/app/Models/Modversion.php @@ -2,18 +2,20 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; class Modversion extends Model { protected $guarded = []; - public function mod() + public function mod(): BelongsTo { return $this->belongsTo(Mod::class); } - public function builds() + public function builds(): BelongsToMany { return $this->belongsToMany(Build::class)->withTimestamps(); } diff --git a/app/Models/User.php b/app/Models/User.php index fb34cd78..f23f64c9 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Database\Eloquent\Model; @@ -35,12 +36,12 @@ class User extends Model implements AuthenticatableContract */ protected $with = ['permission']; - public function permission() + public function permission(): HasOne { return $this->hasOne(UserPermission::class); } - public function updated_by_user() + public function updated_by_user(): HasOne { return $this->hasOne(self::class, 'id', 'updated_by_user_id'); } diff --git a/app/Models/UserPermission.php b/app/Models/UserPermission.php index 909980de..2e2a312d 100644 --- a/app/Models/UserPermission.php +++ b/app/Models/UserPermission.php @@ -2,13 +2,14 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; class UserPermission extends Model { protected $guarded = []; - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class); } From 961d2bdc8f3d71cb87a04e220a4acd9379a6f682 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:36 +0000 Subject: [PATCH 13/15] Mark base controller as `abstract` --- app/Http/Controllers/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 77ec359a..bd3e17ed 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -6,7 +6,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; -class Controller extends BaseController +abstract class Controller extends BaseController { use AuthorizesRequests, ValidatesRequests; } From 64d3da75451f325511c55d05ced874552a183e78 Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:36 +0000 Subject: [PATCH 14/15] Remove `CreatesApplication` testing trait --- tests/CreatesApplication.php | 21 --------------------- tests/TestCase.php | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 tests/CreatesApplication.php diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php deleted file mode 100644 index cc683011..00000000 --- a/tests/CreatesApplication.php +++ /dev/null @@ -1,21 +0,0 @@ -make(Kernel::class)->bootstrap(); - - return $app; - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index 2932d4a6..fe1ffc2f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,5 +6,5 @@ abstract class TestCase extends BaseTestCase { - use CreatesApplication; + // } From 6d80f99904dd556e1f09bf087e7a5f05f455cc2d Mon Sep 17 00:00:00 2001 From: Shift Date: Mon, 18 Mar 2024 00:01:38 +0000 Subject: [PATCH 15/15] Shift cleanup --- app/Models/Build.php | 2 +- app/Models/Client.php | 2 +- app/Models/Mod.php | 2 +- app/Models/Modpack.php | 4 ++-- app/Models/Modversion.php | 2 +- app/Models/User.php | 2 +- app/Models/UserPermission.php | 2 +- config/app.php | 2 -- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/Models/Build.php b/app/Models/Build.php index 4e195e6d..9ee1687f 100644 --- a/app/Models/Build.php +++ b/app/Models/Build.php @@ -2,9 +2,9 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use Illuminate\Database\Eloquent\Model; class Build extends Model { diff --git a/app/Models/Client.php b/app/Models/Client.php index d77ea402..1ffc4453 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -2,8 +2,8 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Client extends Model { diff --git a/app/Models/Mod.php b/app/Models/Mod.php index d652cba2..7251b7fd 100644 --- a/app/Models/Mod.php +++ b/app/Models/Mod.php @@ -2,8 +2,8 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasMany; class Mod extends Model { diff --git a/app/Models/Modpack.php b/app/Models/Modpack.php index 96f86a3e..6e346f53 100644 --- a/app/Models/Modpack.php +++ b/app/Models/Modpack.php @@ -2,9 +2,9 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasMany; class Modpack extends Model { diff --git a/app/Models/Modversion.php b/app/Models/Modversion.php index 60229a19..93f814d3 100644 --- a/app/Models/Modversion.php +++ b/app/Models/Modversion.php @@ -2,9 +2,9 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use Illuminate\Database\Eloquent\Model; class Modversion extends Model { diff --git a/app/Models/User.php b/app/Models/User.php index f23f64c9..852308b3 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,9 +2,9 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasOne; class User extends Model implements AuthenticatableContract { diff --git a/app/Models/UserPermission.php b/app/Models/UserPermission.php index 2e2a312d..3ce8b3dd 100644 --- a/app/Models/UserPermission.php +++ b/app/Models/UserPermission.php @@ -2,8 +2,8 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; class UserPermission extends Model { diff --git a/config/app.php b/config/app.php index a1b1ab42..7dbeebcb 100644 --- a/config/app.php +++ b/config/app.php @@ -1,11 +1,9 @@ Facade::defaultAliases()->merge([ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class,