Skip to content

Commit 19d3526

Browse files
committed
More singularization and correct file names.
1 parent 8ba479e commit 19d3526

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

app/Http/Controllers/Server/ServerController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,13 @@ public function getStartup(Request $request, $uuid)
230230
->first();
231231

232232
$allocation = $server->allocations->pop();
233-
$serverVariables = [
233+
$ServerVariable = [
234234
'{{SERVER_MEMORY}}' => $server->memory,
235235
'{{SERVER_IP}}' => $allocation->ip,
236236
'{{SERVER_PORT}}' => $allocation->port,
237237
];
238238

239-
$processed = str_replace(array_keys($serverVariables), array_values($serverVariables), $server->startup);
239+
$processed = str_replace(array_keys($ServerVariable), array_values($ServerVariable), $server->startup);
240240
foreach ($variables as &$variable) {
241241
$replace = ($variable->user_viewable === 1) ? $variable->a_serverValue : '[hidden]';
242242
$processed = str_replace('{{' . $variable->env_variable . '}}', $replace, $processed);

app/Models/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function option()
263263
*/
264264
public function variables()
265265
{
266-
return $this->hasMany(ServerVariables::class);
266+
return $this->hasMany(ServerVariable::class);
267267
}
268268

269269
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
use Illuminate\Database\Eloquent\Model;
2828

29-
class ServerVariables extends Model
29+
class ServerVariable extends Model
3030
{
3131
/**
3232
* The table associated with the model.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class ServiceVariable extends Model
5454
'required' => 'integer',
5555
];
5656

57-
public function serverVariables()
57+
public function ServerVariable()
5858
{
59-
return $this->hasMany(ServerVariables::class, 'variable_id');
59+
return $this->hasMany(ServerVariable::class, 'variable_id');
6060
}
6161
}

app/Repositories/ServerRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public function create(array $data)
288288
foreach ($variableList as $item) {
289289
$environmentVariables[$item['env']] = $item['val'];
290290

291-
Models\ServerVariables::create([
291+
Models\ServerVariable::create([
292292
'server_id' => $server->id,
293293
'variable_id' => $item['id'],
294294
'variable_value' => $item['val'],
@@ -718,7 +718,7 @@ public function updateStartup($id, array $data, $admin = false)
718718
$environmentVariables[$item['env']] = $item['val'];
719719

720720
// Update model or make a new record if it doesn't exist.
721-
$model = Models\ServerVariables::firstOrNew([
721+
$model = Models\ServerVariable::firstOrNew([
722722
'variable_id' => $item['id'],
723723
'server_id' => $server->id,
724724
]);
@@ -787,7 +787,7 @@ public function deleteNow($id, $force = false)
787787
]);
788788

789789
// Remove Variables
790-
Models\ServerVariables::where('server_id', $server->id)->delete();
790+
Models\ServerVariable::where('server_id', $server->id)->delete();
791791

792792
// Remove Permissions (Foreign Key requires before Subusers)
793793
Models\Permission::where('server_id', $server->id)->delete();

app/Repositories/ServiceRepository/Variable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public function create($id, array $data)
7676

7777
public function delete($id)
7878
{
79-
$variable = Models\ServiceVariable::with('serverVariables')->findOrFail($id);
79+
$variable = Models\ServiceVariable::with('ServerVariable')->findOrFail($id);
8080

8181
DB::beginTransaction();
8282
try {
83-
foreach ($variable->serverVariables as $svar) {
83+
foreach ($variable->ServerVariable as $svar) {
8484
$svar->delete();
8585
}
8686
$variable->delete();

database/migrations/2016_01_23_201649_add_server_variables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Illuminate\Database\Schema\Blueprint;
44
use Illuminate\Database\Migrations\Migration;
55

6-
class AddServerVariables extends Migration
6+
class AddServerVariable extends Migration
77
{
88
/**
99
* Run the migrations.

database/migrations/2016_10_23_203857_add_foreign_server_variables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7-
class AddForeignServerVariables extends Migration
7+
class AddForeignServerVariable extends Migration
88
{
99
/**
1010
* Run the migrations.

public/js/vendor/ace/mode-vbscript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)