Use Laravel’s same return types

This commit is contained in:
Lance Pioch 2024-03-19 21:12:27 -04:00
parent f5269e7e5c
commit 29b3debee2
266 changed files with 641 additions and 637 deletions

View File

@ -29,7 +29,7 @@ class EmailSettingsCommand extends Command
*
* @throws \App\Exceptions\PanelException
*/
public function handle()
public function handle(): void
{
$this->variables['MAIL_DRIVER'] = $this->option('driver') ?? $this->choice(
trans('command/messages.environment.mail.ask_driver'),

View File

@ -22,7 +22,7 @@ class InfoCommand extends Command
/**
* Handle execution of command.
*/
public function handle()
public function handle(): void
{
$this->output->title('Version Information');
$this->table([], [

View File

@ -30,7 +30,7 @@ class CleanServiceBackupFilesCommand extends Command
/**
* Handle command execution.
*/
public function handle()
public function handle(): void
{
$files = $this->disk->files('services/.bak');

View File

@ -12,7 +12,7 @@ class PruneOrphanedBackupsCommand extends Command
protected $description = 'Marks all backups older than "n" minutes that have not yet completed as being failed.';
public function handle()
public function handle(): void
{
$since = $this->option('prune-age') ?? config('backups.prune_age', 360);
if (!$since || !is_digit($since)) {

View File

@ -40,7 +40,7 @@ class MakeNodeCommand extends Command
*
* @throws \App\Exceptions\Model\DataValidationException
*/
public function handle()
public function handle(): void
{
$data['name'] = $this->option('name') ?? $this->ask('Enter a short identifier used to distinguish this node from others');
$data['description'] = $this->option('description') ?? $this->ask('Enter a description to identify the node');

View File

@ -10,7 +10,7 @@ class KeyGenerateCommand extends BaseKeyGenerateCommand
* Override the default Laravel key generation command to throw a warning to the user
* if it appears that they have already generated an application encryption key.
*/
public function handle()
public function handle(): void
{
if (!empty(config('app.key')) && $this->input->isInteractive()) {
$this->output->warning('It appears you have already configured an application encryption key. Continuing with this process with overwrite that key and cause data corruption for any existing encrypted data. DO NOT CONTINUE UNLESS YOU KNOW WHAT YOU ARE DOING.');

View File

@ -32,7 +32,7 @@ class BulkPowerActionCommand extends Command
*
* @throws \Illuminate\Validation\ValidationException
*/
public function handle()
public function handle(): void
{
$action = $this->argument('action');
$nodes = empty($this->option('nodes')) ? [] : explode(',', $this->option('nodes'));

View File

@ -30,7 +30,7 @@ class UpgradeCommand extends Command
*
* @throws \Exception
*/
public function handle()
public function handle(): void
{
$skipDownload = $this->option('skip-download');
if (!$skipDownload) {

View File

@ -16,7 +16,7 @@ class DisableTwoFactorCommand extends Command
*
* @throws \App\Exceptions\Model\DataValidationException
*/
public function handle()
public function handle(): void
{
if ($this->input->isInteractive()) {
$this->output->warning(trans('command/messages.user.2fa_help_text'));

View File

@ -27,7 +27,7 @@ class MakeUserCommand extends Command
* @throws Exception
* @throws \App\Exceptions\Model\DataValidationException
*/
public function handle()
public function handle(): int
{
try {
DB::select('select 1 where 1');

View File

@ -2,8 +2,9 @@
namespace App\Http\Middleware\Activity;
use Illuminate\Http\Request;
use App\Facades\LogTarget;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class AccountSubject
{
@ -11,7 +12,7 @@ class AccountSubject
* Sets the actor and default subject for all requests passing through this
* middleware to be the currently logged in user.
*/
public function handle(Request $request, \Closure $next)
public function handle(Request $request, \Closure $next): Response
{
LogTarget::setActor($request->user());
LogTarget::setSubject($request->user());

View File

@ -2,21 +2,22 @@
namespace App\Http\Middleware\Activity;
use Illuminate\Http\Request;
use App\Models\Server;
use App\Facades\LogTarget;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class ServerSubject
{
/**
* Attempts to automatically scope all of the activity log events registered
* Attempts to automatically scope all the activity log events registered
* within the request instance to the given user and server. This only sets
* the actor and subject if there is a server present on the request.
*
* If no server is found this is a no-op as the activity log service can always
* set the user based on the authmanager response.
*/
public function handle(Request $request, \Closure $next)
public function handle(Request $request, \Closure $next): Response
{
$server = $request->route()->parameter('server');
if ($server instanceof Server) {

View File

@ -2,6 +2,7 @@
namespace App\Http\Middleware\Api\Client;
use Illuminate\Http\Request;
use App\Models\Server;
use Illuminate\Contracts\Routing\Registrar;
use Illuminate\Routing\Middleware\SubstituteBindings;
@ -13,7 +14,7 @@ class SubstituteClientBindings extends SubstituteBindings
parent::__construct($router);
}
public function handle($request, \Closure $next): mixed
public function handle(Request $request, \Closure $next): mixed
{
// Override default behavior of the model binding to use a specific table
// column rather than the default 'id'.

View File

@ -35,7 +35,7 @@ class RunTaskJob extends Job implements ShouldQueue
public function handle(
InitiateBackupService $backupService,
DaemonPowerRepository $powerRepository
) {
): void {
// Do not process a task that is not set to active, unless it's been manually triggered.
if (!$this->task->schedule->is_active && !$this->manualRun) {
$this->markTaskNotQueued();

View File

@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\SoftDeletes;
@ -30,7 +31,7 @@ class ActivityLogSubject extends Pivot
protected $guarded = ['id'];
public function activityLog()
public function activityLog(): BelongsTo
{
return $this->belongsTo(ActivityLog::class);
}

View File

@ -12,7 +12,7 @@ class ActivityLogServiceProvider extends ServiceProvider
* Registers the necessary activity logger singletons scoped to the individual
* request instances.
*/
public function register()
public function register(): void
{
$this->app->scoped(ActivityLogBatchService::class);
$this->app->scoped(ActivityLogTargetableService::class);

View File

@ -22,7 +22,7 @@ class ServerFactory extends Factory
*
* @return array
*/
public function definition()
public function definition(): array
{
return [
'uuid' => Uuid::uuid4()->toString(),

View File

@ -24,7 +24,7 @@ class UserSSHKeyFactory extends Factory
*
* @return array
*/
public function definition()
public function definition(): array
{
$key = PublicKeyLoader::loadPublicKey(static::$keys['ed25519']);

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('allocations', function (Blueprint $table) {
$table->increments('id');
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('allocations');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('api_keys', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('api_keys');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('api_permissions', function (Blueprint $table) {
$table->increments('id');
@ -20,7 +20,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('api_permissions');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('downloads', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('downloads');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('failed_jobs');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
@ -26,7 +26,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('jobs');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('locations', function (Blueprint $table) {
$table->increments('id');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('locations');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('nodes', function (Blueprint $table) {
$table->increments('id');
@ -32,7 +32,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('nodes');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
@ -20,7 +20,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('password_resets');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('permissions', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('permissions');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('server_variables', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('server_variables');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('servers', function (Blueprint $table) {
$table->increments('id');
@ -39,7 +39,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('servers');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('service_options', function (Blueprint $table) {
$table->increments('id');
@ -24,7 +24,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('service_options');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('service_variables', function (Blueprint $table) {
$table->increments('id');
@ -28,7 +28,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('service_variables');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('services', function (Blueprint $table) {
$table->increments('id');
@ -24,7 +24,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('services');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('settings', function (Blueprint $table) {
$table->string('key')->unique();
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('settings');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('subusers', function (Blueprint $table) {
$table->increments('id');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('subusers');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
@ -27,7 +27,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('users');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('sessions');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->renameColumn('permissions', 'permission');
@ -18,7 +18,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('permissions', function (Blueprint $table) {
});

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('databases', function (Blueprint $table) {
$table->increments('id');
@ -25,7 +25,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('databases');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('database_servers', function (Blueprint $table) {
$table->increments('id');
@ -26,7 +26,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('database_servers');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->text('executable')->after('docker_image')->nullable()->default(null);
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropColumn('executable');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->string('file')->unique()->change();
@ -18,7 +18,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropUnique('services_file_unique');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('tasks', function (Blueprint $table) {
$table->increments('id');
@ -32,7 +32,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('tasks');
}

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('tasks_log', function (Blueprint $table) {
$table->increments('id');
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('tasks_log');
}

View File

@ -7,7 +7,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
$table = DB::getQueryGrammar()->wrapTable('tasks');
DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP NULL;');
@ -16,7 +16,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
$table = DB::getQueryGrammar()->wrapTable('tasks');
DB::statement('ALTER TABLE ' . $table . ' CHANGE `last_run` `last_run` TIMESTAMP;');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('allocations', function (Blueprint $table) {
$table->text('ip_alias')->nullable()->after('ip');
@ -29,7 +29,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('allocations', function (Blueprint $table) {
$table->dropColumn('ip_alias');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->mediumInteger('allocation')->unsigned()->after('oom_disabled');
@ -47,7 +47,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->text('ip')->after('allocation');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->tinyInteger('suspended')->unsigned()->default(0)->after('active');
@ -18,7 +18,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropColumn('suspended');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropColumn('active');
@ -18,7 +18,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->tinyInteger('active')->after('name')->unsigned()->default(0);

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->text('sftp_password')->after('username')->nullable();
@ -18,7 +18,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropColumn('sftp_password');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('jobs', function (Blueprint $table) {
$table->dropIndex('jobs_queue_reserved_reserved_at_index');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('jobs', function (Blueprint $table) {
$table->dropIndex('jobs_queue_reserved_at_index');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('failed_jobs', function (Blueprint $table) {
$table->text('exception');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('failed_jobs', function (Blueprint $table) {
$table->dropColumn('exception');

View File

@ -8,7 +8,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->string('id')->primary();
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('notifications');
}

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->char('author', 36)->after('id');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropColumn('author');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_variables', function (Blueprint $table) {
$table->text('regex')->change();
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_variables', function (Blueprint $table) {
$table->string('regex')->change();

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->string('image')->after('daemonSecret');
@ -32,7 +32,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropColumn('image');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->renameColumn('server', 'server_id');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->renameColumn('server_id', 'server');

View File

@ -7,7 +7,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::transaction(function () {
$model = DB::table('service_options')->where('parent_service', 2)->where('id', 3)->where('name', 'Insurgency')->first();
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
}
};

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('api_logs', function (Blueprint $table) {
$table->increments('id');
@ -28,7 +28,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('api_logs');
}

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->unsignedInteger('user')->after('id');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->dropColumn('user');

View File

@ -7,7 +7,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::table('service_variables')->select('env_variable')->where('env_variable', 'BUNGE_VERSION')->update([
'env_variable' => 'BUNGEE_VERSION',
@ -17,7 +17,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
}
};

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE servers
MODIFY COLUMN node INT(10) UNSIGNED NOT NULL,
@ -32,7 +32,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign('servers_node_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE allocations
MODIFY COLUMN assigned_to INT(10) UNSIGNED NULL,
@ -25,7 +25,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('allocations', function (Blueprint $table) {
$table->dropForeign('allocations_assigned_to_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->foreign('user')->references('id')->on('users');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->dropForeign('api_keys_user_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE api_permissions MODIFY key_id INT(10) UNSIGNED NOT NULL');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('api_permissions', function (Blueprint $table) {
$table->dropForeign('api_permissions_key_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('database_servers', function (Blueprint $table) {
$table->foreign('linked_node')->references('id')->on('nodes');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('database_servers', function (Blueprint $table) {
$table->dropForeign('database_servers_linked_node_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->foreign('server_id')->references('id')->on('servers');
@ -20,7 +20,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->dropForeign('databases_server_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE nodes MODIFY location INT(10) UNSIGNED NOT NULL');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('nodes', function (Blueprint $table) {
$table->dropForeign('nodes_location_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->foreign('user_id')->references('id')->on('users');
@ -20,7 +20,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->dropForeign('permissions_user_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE server_variables
MODIFY COLUMN server_id INT(10) UNSIGNED NULL,
@ -25,7 +25,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('server_variables', function (Blueprint $table) {
$table->dropForeign(['server_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE service_options MODIFY parent_service INT(10) UNSIGNED NOT NULL');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropForeign('service_options_parent_service_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::statement('ALTER TABLE service_variables MODIFY option_id INT(10) UNSIGNED NOT NULL');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_variables', function (Blueprint $table) {
$table->dropForeign('service_variables_option_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('subusers', function (Blueprint $table) {
$table->foreign('user_id')->references('id')->on('users');
@ -20,7 +20,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('subusers', function (Blueprint $table) {
$table->dropForeign('subusers_user_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('tasks', function (Blueprint $table) {
$table->foreign('server')->references('id')->on('servers');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('tasks', function (Blueprint $table) {
$table->dropForeign(['server']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('service_packs', function (Blueprint $table) {
$table->increments('id');
@ -29,7 +29,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::drop('service_packs');
}

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->unique('name');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropUnique('services_name_unique');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->unsignedInteger('pack')->nullable()->after('option');
@ -21,7 +21,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign(['pack']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('nodes', function (Blueprint $table) {
$table->unsignedInteger('upload_size')->after('disk_overallocate')->default(100);
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('nodes', function (Blueprint $table) {
$table->dropColumn('upload_size');

View File

@ -7,7 +7,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::transaction(function () {
// Modify Default Spigot Startup Line
@ -66,7 +66,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
// do nothing
}

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::create('node_configuration_tokens', function (Blueprint $table) {
$table->increments('id');
@ -24,7 +24,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::dropIfExists('node_configuration_tokens');
}

View File

@ -10,7 +10,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('name_first')->after('email')->nullable();
@ -34,7 +34,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('name_first');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign('servers_node_foreign');
@ -47,7 +47,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign(['node_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('nodes', function (Blueprint $table) {
$table->dropForeign('nodes_location_foreign');
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('nodes', function (Blueprint $table) {
$table->dropForeign('nodes_location_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('allocations', function (Blueprint $table) {
$table->dropForeign('allocations_node_foreign');
@ -27,7 +27,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('allocations', function (Blueprint $table) {
$table->dropForeign('allocations_node_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropForeign('service_options_parent_service_foreign');
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropForeign('service_options_service_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_packs', function (Blueprint $table) {
$table->dropForeign('service_packs_option_foreign');
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_packs', function (Blueprint $table) {
$table->dropForeign('service_packs_option_id_foreign');

View File

@ -11,7 +11,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->unsignedInteger('subuser_id')->after('id');
@ -42,7 +42,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('permissions', function (Blueprint $table) {
$table->unsignedInteger('server_id')->after('subuser_id');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->dropForeign('api_keys_user_foreign')->dropIndex('api_keys_user_foreign');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('api_keys', function (Blueprint $table) {
$table->dropForeign('api_keys_user_id_foreign')->dropIndex('api_keys_user_id_foreign');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('node_configuration_tokens', function (Blueprint $table) {
$table->dropForeign(['node']);
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('node_configuration_tokens', function (Blueprint $table) {
$table->dropForeign(['node_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->renameColumn('file', 'folder');
@ -22,7 +22,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->string('executable')->after('folder');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropColumn('executable');
@ -27,7 +27,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_options', function (Blueprint $table) {
$table->dropForeign(['config_from']);

View File

@ -7,7 +7,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
DB::transaction(function () {
$service = DB::table('services')->where('author', config('panel.service.core'))->where('folder', 'srcds')->first();
@ -32,7 +32,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
// Not doing reversals right now...
}

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_variables', function (Blueprint $table) {
$table->renameColumn('regex', 'rules');
@ -30,7 +30,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('service_variables', function (Blueprint $table) {
$table->renameColumn('rules', 'regex');

View File

@ -41,7 +41,7 @@ EOF;
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->text('index_file')->after('startup');
@ -61,7 +61,7 @@ EOF;
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropColumn('index_file');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('service_packs', function (Blueprint $table) {
$table->dropForeign(['option_id']);
@ -25,7 +25,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('packs', function (Blueprint $table) {
$table->dropForeign(['option_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('packs', function (Blueprint $table) {
$table->boolean('locked')->default(false)->after('visible');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('packs', function (Blueprint $table) {
$table->dropColumn('locked');

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('database_servers', function (Blueprint $table) {
$table->dropForeign(['linked_node']);
@ -27,7 +27,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('database_hosts', function (Blueprint $table) {
$table->dropForeign(['node_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->dropForeign(['db_server']);
@ -23,7 +23,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('databases', function (Blueprint $table) {
$table->dropForeign(['database_host_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->foreign('pack_id')->references('id')->on('packs');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign(['pack_id']);

View File

@ -9,7 +9,7 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->text('description')->after('name');
@ -19,7 +19,7 @@ return new class extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table('servers', function (Blueprint $table) {
$table->dropColumn('description');

Some files were not shown because too many files have changed in this diff Show More