From c7793c36bbafae35091f3bb12305623af5344e98 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:44:54 +0000 Subject: [PATCH 01/27] 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/ClientController.php | 2 +- app/Http/Controllers/KeyController.php | 2 +- app/Http/Controllers/ModController.php | 10 +++++----- app/Http/Controllers/ModpackController.php | 10 +++++----- app/Http/Controllers/UserController.php | 4 ++-- app/Libraries/UpdateUtils.php | 2 +- app/Models/Modpack.php | 2 +- .../2013_02_27_184039_create_users_table.php | 2 +- .../2013_03_07_230436_create_permissions_table.php | 2 +- routes/web.php | 6 +++--- tests/Unit/UserTest.php | 8 ++++---- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index afd869ae..3bac465e 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -46,7 +46,7 @@ public function postCreate(): RedirectResponse return redirect('client/create')->withErrors($validation->messages()); } - $client = new Client(); + $client = new Client; $client->name = Request::input('name'); $client->uuid = Request::input('uuid'); $client->save(); diff --git a/app/Http/Controllers/KeyController.php b/app/Http/Controllers/KeyController.php index 3024eed5..50f8f671 100644 --- a/app/Http/Controllers/KeyController.php +++ b/app/Http/Controllers/KeyController.php @@ -46,7 +46,7 @@ public function postCreate(): RedirectResponse return redirect('key/create')->withErrors($validation->messages()); } - $key = new Key(); + $key = new Key; $key->name = Request::input('name'); $key->api_key = Request::input('api_key'); $key->save(); diff --git a/app/Http/Controllers/ModController.php b/app/Http/Controllers/ModController.php index 676f1dc4..1a26bdcc 100644 --- a/app/Http/Controllers/ModController.php +++ b/app/Http/Controllers/ModController.php @@ -80,7 +80,7 @@ public function postCreate(): RedirectResponse return redirect('mod/create')->withErrors($validation->messages()); } - $mod = new Mod(); + $mod = new Mod; $mod->name = Str::slug(Request::input('name')); $mod->pretty_name = Request::input('pretty_name'); $mod->author = Request::input('author'); @@ -264,7 +264,7 @@ public function anyAddVersion(): JsonResponse $pfile_md5 = ! $file_md5['success'] ? 'Null' : $file_md5['md5']; } - $ver = new Modversion(); + $ver = new Modversion; $ver->mod_id = $mod->id; $ver->version = $version; @@ -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..cf6260ac 100644 --- a/app/Http/Controllers/ModpackController.php +++ b/app/Http/Controllers/ModpackController.php @@ -215,7 +215,7 @@ public function postAddBuild($modpack_id) } $clone = Request::input('clone'); - $build = new Build(); + $build = new Build; $build->modpack_id = $modpack->id; $build->version = Request::input('version'); @@ -263,7 +263,7 @@ public function postCreate(): RedirectResponse return redirect('modpack/create')->withErrors($validation->messages()); } - $modpack = new Modpack(); + $modpack = new Modpack; $modpack->name = Request::input('name'); $modpack->slug = Str::slug(Request::input('slug')); $modpack->hidden = Request::input('hidden') ? false : true; @@ -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/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index c37315e9..b89ac817 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -169,7 +169,7 @@ public function postCreate(): RedirectResponse $creator = Auth::user()->id; $creatorIP = Request::ip(); - $user = new User(); + $user = new User; $user->email = Request::input('email'); $user->username = Request::input('username'); $user->password = Hash::make(Request::input('password')); @@ -179,7 +179,7 @@ public function postCreate(): RedirectResponse $user->updated_by_user_id = $creator; $user->save(); - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = $user->id; $perm->solder_full = Request::input('solder-full') ? true : false; diff --git a/app/Libraries/UpdateUtils.php b/app/Libraries/UpdateUtils.php index 642e91f6..4d04e642 100644 --- a/app/Libraries/UpdateUtils.php +++ b/app/Libraries/UpdateUtils.php @@ -11,7 +11,7 @@ class UpdateUtils public static function getGithubClient(): Client { - return self::$githubClient ??= new Client(); + return self::$githubClient ??= new Client; } public static function getUpdateCheck($forceRefresh = false): bool 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/database/migrations/2013_02_27_184039_create_users_table.php b/database/migrations/2013_02_27_184039_create_users_table.php index df29c1af..d95f0ae9 100644 --- a/database/migrations/2013_02_27_184039_create_users_table.php +++ b/database/migrations/2013_02_27_184039_create_users_table.php @@ -25,7 +25,7 @@ public function up(): void * Create default user (if one doesn't exist) **/ if (User::count() == 0) { - $user = new User(); + $user = new User; $user->username = 'admin'; $user->email = 'admin@admin.com'; $user->password = Hash::make('admin'); diff --git a/database/migrations/2013_03_07_230436_create_permissions_table.php b/database/migrations/2013_03_07_230436_create_permissions_table.php index 7586365b..c39d08da 100644 --- a/database/migrations/2013_03_07_230436_create_permissions_table.php +++ b/database/migrations/2013_03_07_230436_create_permissions_table.php @@ -25,7 +25,7 @@ public function up(): void $table->nullableTimestamps(); }); - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = 1; $perm->solder_full = true; $perm->save(); 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'); diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php index 14900331..3837c8f0 100644 --- a/tests/Unit/UserTest.php +++ b/tests/Unit/UserTest.php @@ -163,7 +163,7 @@ public function test_user_delete_get(): void 'created_by_user_id' => 1, ]); - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = $user->id; $perm->save(); @@ -195,7 +195,7 @@ public function test_user_delete_post(): void 'created_by_user_id' => 1, ]); - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = $user->id; $perm->save(); @@ -217,7 +217,7 @@ public function test_user_cannot_delete_last_admin_post(): void ]); // Allow this user to manage users, but not be an admin - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = $user->id; $perm->solder_users = 1; $perm->save(); @@ -263,7 +263,7 @@ public function test_user_delete_first_post(): void 'created_by_user_id' => 1, ]); - $perm = new UserPermission(); + $perm = new UserPermission; $perm->user_id = $user->id; $perm->solder_full = 1; $perm->save(); From a85868f25e137407205f5471a10a87a869d199d3 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:05 +0000 Subject: [PATCH 02/27] Remove default `app` files --- 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/BroadcastServiceProvider.php | 19 -------- app/Providers/RouteServiceProvider.php | 48 ------------------- 11 files changed, 254 deletions(-) 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/BroadcastServiceProvider.php delete mode 100644 app/Providers/RouteServiceProvider.php 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 @@ -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 06aa70637266dc4064eb022da9efccad9aff59e8 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:05 +0000 Subject: [PATCH 03/27] 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 d222b305940050dcb9a790c940e1b6860cec56b9 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:11 +0000 Subject: [PATCH 04/27] 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 1041660c097e2abc4c4964fb54fe6a219fc0149c Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:11 +0000 Subject: [PATCH 05/27] Set new `ENV` variables --- .env.example | 16 ++++++++++++++-- docker/.env | 4 ++-- phpunit.xml | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index d56ebcf3..07c33575 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,16 @@ APP_KEY= APP_DEBUG=false APP_URL=http://localhost +APP_TIMEZONE=UTC +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 +22,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 9c347edf21ac155490be996f5d47bd6dbd067093 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:11 +0000 Subject: [PATCH 06/27] 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: Thu, 28 Nov 2024 17:45:11 +0000 Subject: [PATCH 07/27] 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 c7c1e94cb7e9da05c783d3aac6fc2998b37ecc2a Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:12 +0000 Subject: [PATCH 08/27] Consolidate service providers --- app/Providers/AppServiceProvider.php | 21 ++++++++++++++ app/Providers/AuthServiceProvider.php | 25 ----------------- app/Providers/EventServiceProvider.php | 38 -------------------------- bootstrap/app.php | 3 +- 4 files changed, 23 insertions(+), 64 deletions(-) delete mode 100644 app/Providers/AuthServiceProvider.php delete mode 100644 app/Providers/EventServiceProvider.php diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ab1f8ce4..296293a4 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,12 +3,24 @@ namespace App\Providers; use App\Models\Modpack; +use Illuminate\Cache\RateLimiting\Limit; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; 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. */ @@ -36,5 +48,14 @@ public function boot(): void $view->with('allModpacks', $modpacks); }); + + $this->bootRoute(); + } + + public function bootRoute(): void + { + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); + }); } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php deleted file mode 100644 index d1015ed5..00000000 --- a/app/Providers/AuthServiceProvider.php +++ /dev/null @@ -1,25 +0,0 @@ - 'App\Policies\ModelPolicy', - ]; - - /** - * Register any authentication / authorization services. - */ - public function boot(): void - { - // - } -} diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php deleted file mode 100644 index d763dba9..00000000 --- a/app/Providers/EventServiceProvider.php +++ /dev/null @@ -1,38 +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/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 ab3ebce0ebfbde24bbbd15efbf0d60c4190082ab Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:12 +0000 Subject: [PATCH 09/27] 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 e3a7908e74b7daa79730a163e1fbf73e46e8cc16 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:12 +0000 Subject: [PATCH 10/27] Re-register exception handling --- app/Exceptions/Handler.php | 48 -------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 app/Exceptions/Handler.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) { - // - }); - } -} From 469c42a8a8d566c9e821439b52fe3310e2587533 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:14 +0000 Subject: [PATCH 11/27] 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 44de85aabf943b4f961528f548302813321ba51e Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:14 +0000 Subject: [PATCH 12/27] Remove unnecessary Console Kernel --- app/Console/Kernel.php | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 app/Console/Kernel.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'); - } -} From d366fcd5b79566f1c94dc0ae381c1601c92d1b3e Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:14 +0000 Subject: [PATCH 13/27] Bump Composer dependencies --- composer.json | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 86ad616c..b5442b56 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,16 @@ "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.34", + "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" + "nunomaduro/collision": "^8.0", + "phpunit/phpunit": "^10.5", + "fakerphp/faker": "^1.23.0" }, "config": { "optimize-autoloader": true, From d62ba39d1947af7f6258383dcbbe3f70cedc0ec3 Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:17 +0000 Subject: [PATCH 14/27] 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 52f33ab25e5cd5090501e5ba2cf7e7f4b02712bd Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:17 +0000 Subject: [PATCH 15/27] 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 f7ac008c0a384133fd20b8a4854de6a75282f2fc Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:17 +0000 Subject: [PATCH 16/27] 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 522b05332257a7111a2031200d9d429676aaf67c Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 28 Nov 2024 17:45:18 +0000 Subject: [PATCH 17/27] 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, From 825aae653560487876a138e2183358ac7d1ddc7e Mon Sep 17 00:00:00 2001 From: Pedro Cunha Date: Thu, 28 Nov 2024 20:50:39 +0000 Subject: [PATCH 18/27] fix(deps): remove dependency on `laravelcollective/html` --- bootstrap/app.php | 3 - composer.json | 3 +- resources/views/client/create.blade.php | 62 ++++++------ resources/views/client/delete.blade.php | 16 ++-- resources/views/client/list.blade.php | 95 ++++++++++--------- resources/views/dashboard/index.blade.php | 26 ++--- resources/views/dashboard/login.blade.php | 17 ++-- resources/views/key/create.blade.php | 62 ++++++------ resources/views/key/delete.blade.php | 6 +- resources/views/key/list.blade.php | 2 +- resources/views/mod/create.blade.php | 6 +- resources/views/mod/delete.blade.php | 83 ++++++++-------- resources/views/mod/list.blade.php | 19 ++-- resources/views/mod/view.blade.php | 25 ++--- .../views/modpack/build/create.blade.php | 8 +- .../views/modpack/build/delete.blade.php | 6 +- resources/views/modpack/build/edit.blade.php | 10 +- resources/views/modpack/build/view.blade.php | 17 ++-- resources/views/modpack/create.blade.php | 81 ++++++++-------- resources/views/modpack/delete.blade.php | 32 ++++--- resources/views/modpack/edit.blade.php | 10 +- resources/views/modpack/list.blade.php | 6 +- resources/views/modpack/view.blade.php | 6 +- resources/views/user/create.blade.php | 8 +- resources/views/user/delete.blade.php | 6 +- resources/views/user/edit.blade.php | 10 +- resources/views/user/list.blade.php | 5 +- 27 files changed, 331 insertions(+), 299 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index e027ce2d..3762abdb 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -6,9 +6,6 @@ use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) - ->withProviders([ - \Collective\Html\HtmlServiceProvider::class, - ]) ->withRouting( web: __DIR__.'/../routes/web.php', api: __DIR__.'/../routes/api.php', diff --git a/composer.json b/composer.json index b5442b56..880d6950 100644 --- a/composer.json +++ b/composer.json @@ -41,8 +41,7 @@ "intervention/image": "^2.7.2", "knplabs/github-api": "^3.12", "laravel/framework": "^11.34", - "laravel/tinker": "^2.9", - "laravelcollective/html": "^6.4.1" + "laravel/tinker": "^2.9" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.10", diff --git a/resources/views/client/create.blade.php b/resources/views/client/create.blade.php index 40c27bf7..f7f14572 100644 --- a/resources/views/client/create.blade.php +++ b/resources/views/client/create.blade.php @@ -3,37 +3,37 @@ Create Client - Technic Solder @stop @section('content') -

Client Management

-
-
-
- Add Client -
-
- @if ($errors->all()) -
- @foreach ($errors->all() as $error) - {{ $error }}
- @endforeach -
- @endif -
-
- {!! Form::open() !!} - {!! Form::hidden("add-client", 1) !!} -
- - +

Client Management

+
+
+
+ Add Client +
+
+ @if ($errors->all()) +
+ @foreach ($errors->all() as $error) + {{ $error }}
+ @endforeach
-
- - + @endif +
+
+
+ +
+ + +
+
+ + +
+ + Go Back +
- {!! Form::submit('Add Client', ['class' => 'btn btn-success']) !!} - {!! Html::link('client/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} -
-
-
-
+
+
+
@endsection \ No newline at end of file diff --git a/resources/views/client/delete.blade.php b/resources/views/client/delete.blade.php index 5d88a592..0881bb7b 100644 --- a/resources/views/client/delete.blade.php +++ b/resources/views/client/delete.blade.php @@ -3,12 +3,12 @@ Client Management - Technic Solder @stop @section('content') -

Client Management

-
-

Delete Client ({{ $client->name }})

-

This will immediately remove access to all modpacks this user has access to.

-
- - {!! Html::link('client/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} -
+

Client Management

+
+

Delete Client ({{ $client->name }})

+

This will immediately remove access to all modpacks this user has access to.

+
+ + Go Back +
@endsection \ No newline at end of file diff --git a/resources/views/client/list.blade.php b/resources/views/client/list.blade.php index 51522b23..1effa5a7 100644 --- a/resources/views/client/list.blade.php +++ b/resources/views/client/list.blade.php @@ -3,51 +3,56 @@ Client Management - Technic Solder @stop @section('content') -

Client Management

-
-
-
- - Client List -
-
-

This is the client management area. Here you can register your launcher client UUID to Solder so that private builds will show up to you in the launcher. After a client is added to this list, they need to be linked to the modpacks you want them to have access to in Solder.

- @if (Session::has('success')) -
- {{ Session::get('success') }} -
- @endif -
- - - - - - - - - - - @foreach ($clients as $client) - - - - - - - @endforeach - -
#NameClient UUIDActions
{{ $client->id }}{{ $client->name }}{{ $client->uuid }}{!! Html::link('client/delete/'.$client->id, 'Delete', ['class' => 'btn btn-danger btn-xs']) !!}
-
-
-
+

Client Management

+
+
+
+ + Client List +
+
+

This is the client management area. Here you can register your launcher client UUID to Solder so that + private builds will show up to you in the launcher. After a client is added to this list, they need to + be linked to the modpacks you want them to have access to in Solder.

+ @if (Session::has('success')) +
+ {{ Session::get('success') }} +
+ @endif +
+ + + + + + + + + + + @foreach ($clients as $client) + + + + + + + @endforeach + +
#NameClient UUIDActions
{{ $client->id }}{{ $client->name }}{{ $client->uuid }}Delete
+
+
+
@endsection @section('bottom') - + @endsection \ No newline at end of file diff --git a/resources/views/dashboard/index.blade.php b/resources/views/dashboard/index.blade.php index 5cc68766..10aef7d2 100644 --- a/resources/views/dashboard/index.blade.php +++ b/resources/views/dashboard/index.blade.php @@ -44,7 +44,7 @@ {{ $build->minecraft }} {{ $build->modversions_count }} {{ $build->updated_at }} - {!! Html::link('modpack/build/'.$build->id, 'Manage Build', ['class' => 'btn btn-warning btn-xs']) !!} + Manage Build @endforeach @@ -77,17 +77,19 @@ @foreach ($modversions as $modversion) - {!! Html::link('mod/view/'.$modversion->mod->id, $modversion->mod->id) !!} + {{ $modversion->mod->id }} {{ $modversion->version }} - @if (!empty($modversion->mod->pretty_name)) - {!! Html::link('mod/view/'.$modversion->mod->id, $modversion->mod->pretty_name) !!} ({{ $modversion->mod->name }}) - @else - {!! Html::link('mod/view/'.$modversion->mod->id, $modversion->mod->name) !!} - @endif - {{ !empty($modversion->mod->author) ? $modversion->mod->author : "N/A" }} - {!! !empty($modversion->mod->link) ? Html::link($modversion->mod->link, $modversion->mod->link, ["target" => "_blank"]) : "N/A" !!} + {{ $modversion->mod->pretty_name ?: $modversion->mod->name }} + {{ $modversion->mod->author ?: "N/A" }} + + @if (empty($modversion->mod->link)) + N/A + @else + {{ $modversion->mod->link }} + @endif + {{ $modversion->created_at }} - {!! Html::link('mod/view/'.$modversion->mod->id.'#versions','Manage', ["class" => "btn btn-xs btn-primary"]) !!} + Manage @endforeach @@ -111,7 +113,7 @@ @else
    @foreach ($changelog as $change) -
  • {!! Html::link($change['html_url'], substr($change['sha'], 0, 7)) !!} {{ explode("\n", $change['commit']['message'], 2)[0] }}
  • +
  • {{ substr($change['sha'], 0, 7) }} {{ explode("\n", $change['commit']['message'], 2)[0] }}
  • @endforeach
@endif @@ -119,5 +121,5 @@
-

TechnicSolder is an open source project. It is under the MIT license. Source Code: https://github.com/TechnicPack/TechnicSolder

+

TechnicSolder is an open source project. It is under the MIT license. Source Code: https://github.com/TechnicPack/TechnicSolder

@endsection diff --git a/resources/views/dashboard/login.blade.php b/resources/views/dashboard/login.blade.php index fab25e74..4a5e6355 100644 --- a/resources/views/dashboard/login.blade.php +++ b/resources/views/dashboard/login.blade.php @@ -6,15 +6,14 @@ - - - - {!! Html::style('css/login.css') !!} + + + -
+
- + Technic Solder @@ -28,10 +27,10 @@
  • {{ Session::get('logout') }}
  • @endif - - + + - + diff --git a/resources/views/key/create.blade.php b/resources/views/key/create.blade.php index 7d919d0f..5a8073d3 100644 --- a/resources/views/key/create.blade.php +++ b/resources/views/key/create.blade.php @@ -3,37 +3,37 @@ Create API Key - Technic Solder @stop @section('content') -

    API Key Management

    -
    -
    -
    - Add API Key -
    -
    - @if ($errors->all()) -
    - @foreach ($errors->all() as $error) - {{ $error }}
    - @endforeach -
    - @endif -
    -
    - {!! Form::open() !!} - {!! Form::hidden("add-key", 1) !!} -
    - - +

    API Key Management

    +
    +
    +
    + Add API Key +
    +
    + @if ($errors->all()) +
    + @foreach ($errors->all() as $error) + {{ $error }}
    + @endforeach
    -
    - - + @endif +
    +
    + + +
    + + +
    +
    + + +
    + + Go Back +
    - {!! Form::submit('Add Key', ['class' => 'btn btn-success']) !!} - {!! Html::link('key/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} -
    -
    -
    -
    +
    +
    +
    @endsection \ No newline at end of file diff --git a/resources/views/key/delete.blade.php b/resources/views/key/delete.blade.php index 5a003561..590eff3a 100644 --- a/resources/views/key/delete.blade.php +++ b/resources/views/key/delete.blade.php @@ -7,8 +7,8 @@

    Delete API Key ({{ $key->name }})

    This will immediately remove access to Solder using this API Key. Make sure to unlink any packs using this key before doing this.

    -
    - - {!! Html::link('key/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} + + + Go Back
    @endsection \ No newline at end of file diff --git a/resources/views/key/list.blade.php b/resources/views/key/list.blade.php index 9f5de554..0cd574a3 100644 --- a/resources/views/key/list.blade.php +++ b/resources/views/key/list.blade.php @@ -35,7 +35,7 @@ {{ $key->id }} {{ $key->name }} {{ $key->api_key }} - {!! Html::link('key/delete/'.$key->id, 'Delete', ['class' => 'btn btn-danger btn-xs']) !!} + Delete @endforeach diff --git a/resources/views/mod/create.blade.php b/resources/views/mod/create.blade.php index 1e4bee59..f8299fe4 100644 --- a/resources/views/mod/create.blade.php +++ b/resources/views/mod/create.blade.php @@ -18,7 +18,7 @@ @endforeach
    @endif -
    +
    @@ -49,8 +49,8 @@
    - {!! Form::submit('Add Mod', ['class' => 'btn btn-success']) !!} - {!! Html::link('mod/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} + + Go Back
    diff --git a/resources/views/mod/delete.blade.php b/resources/views/mod/delete.blade.php index 66e74a1e..9d0b2242 100644 --- a/resources/views/mod/delete.blade.php +++ b/resources/views/mod/delete.blade.php @@ -3,46 +3,51 @@ Mod Management - Technic Solder @stop @section('content') - -
    -
    - Delete Request for {{ $mod->name }} -
    -
    -

    Deleting a mod can have serious reprecussions. All associated modpacks and builds using this mod will have the mod forcefully stripped from their build history. This includes every version of the mod in every build it existed in. This tool should mainly be used to delete a mod you created by mistake or are entirely sure is no longer needed. For your convenience we have generated a list of all builds currently using this mod for every version of the mod. Please carefully check the versions list before removing the mod!

    -

    Deleting a mod is irreverisble!

    -
    -
    -
    - - Versions - + +
    +
    + Delete Request for {{ $mod->name }}
    -
    -
    -
      - @foreach ($mod->versions as $ver) -
    • {{ $ver->version }}
    • - @if (count($ver->builds) >= 1) -
        - @foreach ($ver->builds as $build) -
      • {{ $build->modpack->name }} - {{ $build->version }}
      • - @endforeach -
      - @endif - @endforeach -
    -
    +
    +

    Deleting a mod can have serious repercussions. All associated modpacks and builds using this mod will + have the mod forcefully stripped from their build history. This includes every version of the mod in + every build it existed in. This tool should mainly be used to delete a mod you created by mistake or are + entirely sure is no longer needed. For your convenience we have generated a list of all builds currently + using this mod for every version of the mod. Please carefully check the versions list before + removing the mod!

    +

    Deleting a mod is irreversible!

    +
    +
    + +
    +
    +
      + @foreach ($mod->versions as $ver) +
    • {{ $ver->version }}
    • + @if (count($ver->builds) >= 1) +
        + @foreach ($ver->builds as $build) +
      • {{ $build->modpack->name }} - {{ $build->version }}
      • + @endforeach +
      + @endif + @endforeach +
    +
    +
    +
    +
    +
    +
    + + Go Back +
    -
    - {!! Form::open() !!} -
    - {!! Form::submit('Delete Mod', ['class' => 'btn btn-danger']) !!} - {!! Html::link('mod/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} -
    -
    @endsection \ No newline at end of file diff --git a/resources/views/mod/list.blade.php b/resources/views/mod/list.blade.php index a6692880..8c342a6b 100644 --- a/resources/views/mod/list.blade.php +++ b/resources/views/mod/list.blade.php @@ -39,19 +39,24 @@ @foreach ($mods as $mod) - {!! Html::link('mod/view/'.$mod->id, $mod->id) !!} + {{ $mod->id }} + {{ $mod->pretty_name ?: $mod->name }} @if (!empty($mod->pretty_name)) - {!! Html::link('mod/view/'.$mod->id, $mod->pretty_name) !!} ({{ $mod->name }}) - @else - {!! Html::link('mod/view/'.$mod->id, $mod->name) !!} + ({{ $mod->name }}) @endif -
    +
    Latest Version: {{ !$mod->versions->isEmpty() ? $mod->versions->first()->version : "N/A" }} {{ !empty($mod->author) ? $mod->author : "N/A" }} - {!! !empty($mod->link) ? Html::link($mod->link, $mod->link, ["target" => "_blank"]) : "N/A" !!} - {!! Html::link('mod/view/'.$mod->id,'Manage', ["class" => "btn btn-xs btn-primary"]) !!} + + @if (!empty($mod->link)) + {{ $mod->link }} + @else + N/A + @endif + + Manage @endforeach diff --git a/resources/views/mod/view.blade.php b/resources/views/mod/view.blade.php index d52dd860..d8ec71ee 100644 --- a/resources/views/mod/view.blade.php +++ b/resources/views/mod/view.blade.php @@ -34,7 +34,7 @@ {{ Session::get('success') }}
    @endif -
    +
    @@ -59,9 +59,9 @@
    - {!! Form::submit('Save Changes', ['class' => 'btn btn-success']) !!} - {!! Html::link('mod/delete/'.$mod->id, 'Delete Mod', ['class' => 'btn btn-danger']) !!} - {!! Html::link('mod/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} + + Delete Mod + Go Back
    @@ -79,7 +79,7 @@ -
    + @@ -89,19 +89,19 @@ N/A N/A - +
    @foreach ($mod->versions->sortByDesc('id') as $ver) -
    + {{ $ver->version }} {{ config('solder.mirror_url').'mods/'.$mod->name.'/'.$mod->name.'-'.$ver->version.'.zip' }} {{ $ver->humanFilesize() }} - +
    @@ -112,7 +112,11 @@

    Builds used in:

      @foreach ($ver->builds as $build) -
    • {!! Html::link('modpack/view/'.$build->modpack->id,$build->modpack->name) !!} - {!! Html::link('modpack/build/'.$build->id,$build->version) !!}
    • +
    • + {{ $build->modpack->name }} + - + {{ $build->version }} +
    • @endforeach
    @endif @@ -180,7 +184,7 @@ $.ajax({ type: "POST", - url: "{{ url('mod/rehash') }}", + url: "{{ url('/mod/rehash') }}", data: $(this).serialize(), success: function (data) { if (data.status === "success") { @@ -201,7 +205,6 @@ }); $('.delete').click(function(e) { - e.preventDefault(); $.ajax({ type: "POST", url: "{{ URL::to('mod/delete-version') }}/" + $(this).attr('rel'), diff --git a/resources/views/modpack/build/create.blade.php b/resources/views/modpack/build/create.blade.php index 0c3024a1..d542b3d4 100644 --- a/resources/views/modpack/build/create.blade.php +++ b/resources/views/modpack/build/create.blade.php @@ -18,7 +18,7 @@ @endforeach
    @endif - {!! Form::open() !!} +

    Create Build

    @@ -76,9 +76,9 @@

    - {!! Form::submit('Add Build', ['class' => 'btn btn-success']) !!} - {!! Html::link('modpack/view/'.$modpack->id, 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} + + Go Back +
    @endsection diff --git a/resources/views/modpack/build/delete.blade.php b/resources/views/modpack/build/delete.blade.php index e853e1fc..cec1f9bb 100644 --- a/resources/views/modpack/build/delete.blade.php +++ b/resources/views/modpack/build/delete.blade.php @@ -11,10 +11,10 @@

    Are you sure you want to delete this build? This action is irreversible!

    -
    + - {!! Form::submit('Delete Build', ['class' => 'btn btn-danger']) !!} - {!! Html::link('modpack/view/'.$build->modpack->id, 'Go Back', ['class' => 'btn btn-primary']) !!} + + Go Back
    diff --git a/resources/views/modpack/build/edit.blade.php b/resources/views/modpack/build/edit.blade.php index f88915dd..3de63c85 100644 --- a/resources/views/modpack/build/edit.blade.php +++ b/resources/views/modpack/build/edit.blade.php @@ -18,7 +18,7 @@ @endforeach @endif - {!! Form::open(['url' => URL::full() ]) !!} +
    @@ -68,10 +68,10 @@

    - {!! Form::submit('Update Build', ['class' => 'btn btn-success']) !!} - {!! Html::link('modpack/build/'.$build->id.'?action=delete', 'Delete Build', ['class' => 'btn btn-danger']) !!} - {!! Html::link('modpack/build/'.$build->id, 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} + + Delete Build + Go Back +
    @endsection diff --git a/resources/views/modpack/build/view.blade.php b/resources/views/modpack/build/view.blade.php index 8c725d54..89db9baa 100644 --- a/resources/views/modpack/build/view.blade.php +++ b/resources/views/modpack/build/view.blade.php @@ -43,7 +43,7 @@ -
    + @@ -61,7 +61,7 @@ - +
    @@ -85,9 +85,12 @@ @foreach ($build->modversions->sortByDesc('build_id', SORT_NATURAL) as $ver) - {!! Html::link('mod/view/'.$ver->mod->id, $ver->mod->pretty_name) !!} ({{ $ver->mod->name }}) -
    + {{ $ver->mod->pretty_name ?: $ver->mod->name }} + ({{ $ver->mod->name }}) + + + @@ -98,17 +101,17 @@ @endforeach - +
    -
    + - +
    diff --git a/resources/views/modpack/create.blade.php b/resources/views/modpack/create.blade.php index 2e34ced0..1d34a689 100644 --- a/resources/views/modpack/create.blade.php +++ b/resources/views/modpack/create.blade.php @@ -3,44 +3,45 @@ Create Modpack - Technic Solder @stop @section('content') - -
    -
    - Create Modpack -
    -
    - @if ($errors->all()) -
    - @foreach ($errors->all() as $error) - {{ $error }}
    - @endforeach -
    - @endif - {!! Form::open() !!} -
    -
    -
    - - -
    -
    - - -
    -
    -
    -

    Creating a modpack is simple. Fill in the information here.

    -

    If you wish to link this modpack with an existing Technic Platform modpack, the slug must be identical to your slug on the Platform!

    -
    -
    - {!! Form::submit('Add Modpack', ['class' => 'btn btn-success']) !!} - {!! Html::link('modpack/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} -
    -
    - + +
    +
    + Create Modpack +
    +
    + @if ($errors->all()) +
    + @foreach ($errors->all() as $error) + {{ $error }}
    + @endforeach +
    + @endif +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +

    Creating a modpack is simple. Fill in the information here.

    +

    If you wish to link this modpack with an existing Technic Platform modpack, the slug must be + identical to your slug on the Platform!

    +
    +
    + + Go Back +
    +
    +
    + @endsection \ No newline at end of file diff --git a/resources/views/modpack/delete.blade.php b/resources/views/modpack/delete.blade.php index fd56b0f4..52ec4d34 100644 --- a/resources/views/modpack/delete.blade.php +++ b/resources/views/modpack/delete.blade.php @@ -3,19 +3,21 @@ {{ $modpack->name }} - Technic Solder @stop @section('content') - -
    -
    - Delete Modpack: {{ $modpack->name }} -
    -
    -

    Deleting a modpack is irreversible. All associated builds will be immediately removed. This will remove them from your API. Users with this modpack already on their launcher will be able to continue to use it in "Offline Mode."

    - {!! Form::open() !!} - - {!! Html::link('modpack/list/', 'Go Back', ['class' => 'btn btn-primary']) !!} - {!! Form::close() !!} -
    -
    + +
    +
    + Delete Modpack: {{ $modpack->name }} +
    +
    +

    Deleting a modpack is irreversible. All associated builds will be immediately removed. This will remove + them from your API. Users with this modpack already on their launcher will be able to continue to use it + in "Offline Mode."

    +
    + + Go Back +
    +
    +
    @endsection \ No newline at end of file diff --git a/resources/views/modpack/edit.blade.php b/resources/views/modpack/edit.blade.php index 73df5100..de644765 100644 --- a/resources/views/modpack/edit.blade.php +++ b/resources/views/modpack/edit.blade.php @@ -18,7 +18,7 @@ @endforeach @endif -
    +

    Modpack Management

    @@ -69,12 +69,12 @@

    - {!! Form::submit('Save Modpack', ['class' => 'btn btn-success']) !!} - {!! Html::link('modpack/delete/' . $modpack->id, 'Delete Modpack', ['class' => 'btn btn-danger']) !!} - {!! Html::link(URL::previous(), 'Go Back', ['class' => 'btn btn-primary']) !!} + + Delete Modpack + Go Back
    - {!! Form::close() !!} +