Skip to content

Commit 8ba479e

Browse files
committed
Singularize model names.
1 parent 7c916ad commit 8ba479e

25 files changed

+73
-73
lines changed

app/Http/Controllers/Admin/PackController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function listAll(Request $request)
4949
public function listByOption(Request $request, $id)
5050
{
5151
return view('admin.services.packs.byoption', [
52-
'option' => Models\ServiceOptions::with('service', 'packs')->findOrFail($id),
52+
'option' => Models\ServiceOption::with('service', 'packs')->findOrFail($id),
5353
]);
5454
}
5555

app/Http/Controllers/Admin/ServersController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function postNewServerGetIps(Request $request)
152152
* @param \Illuminate\Http\Request $request
153153
* @return \Illuminate\Contracts\View\View
154154
*/
155-
public function postNewServerServiceOptions(Request $request)
155+
public function postNewServerServiceOption(Request $request)
156156
{
157157
if (! $request->input('service')) {
158158
return response()->json([
@@ -162,7 +162,7 @@ public function postNewServerServiceOptions(Request $request)
162162

163163
$service = Models\Service::select('executable', 'startup')->where('id', $request->input('service'))->first();
164164

165-
return response()->json(Models\ServiceOptions::select('id', 'name', 'docker_image')->where('service_id', $request->input('service'))->orderBy('name', 'asc')->get());
165+
return response()->json(Models\ServiceOption::select('id', 'name', 'docker_image')->where('service_id', $request->input('service'))->orderBy('name', 'asc')->get());
166166
}
167167

168168
/**
@@ -179,7 +179,7 @@ public function postNewServerOptionDetails(Request $request)
179179
], 500);
180180
}
181181

182-
$option = Models\ServiceOptions::with('variables')->with(['packs' => function ($query) {
182+
$option = Models\ServiceOption::with('variables')->with(['packs' => function ($query) {
183183
$query->where('selectable', true);
184184
}])->findOrFail($request->input('option'));
185185

app/Http/Controllers/Admin/ServiceController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function deleteService(Request $request, $service)
124124

125125
public function getOption(Request $request, $service, $option)
126126
{
127-
$option = Models\ServiceOptions::with('service', 'variables')->findOrFail($option);
127+
$option = Models\ServiceOption::with('service', 'variables')->findOrFail($option);
128128
$option->setRelation('servers', $option->servers()->with('user')->paginate(25));
129129

130130
return view('admin.services.options.view', ['option' => $option]);
@@ -205,7 +205,7 @@ public function postOptionVariable(Request $request, $service, $option, $variabl
205205
public function getNewVariable(Request $request, $service, $option)
206206
{
207207
return view('admin.services.options.variable', [
208-
'option' => Models\ServiceOptions::with('service')->findOrFail($option),
208+
'option' => Models\ServiceOption::with('service')->findOrFail($option),
209209
]);
210210
}
211211

app/Http/Controllers/Server/ServerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function getStartup(Request $request, $uuid)
214214
}]);
215215
$this->authorize('view-startup', $server);
216216

217-
$variables = Models\ServiceVariables::select(
217+
$variables = Models\ServiceVariable::select(
218218
'service_variables.*',
219219
DB::raw('COALESCE(server_variables.variable_value, service_variables.default_value) as a_serverValue')
220220
)->leftJoin('server_variables', 'server_variables.variable_id', '=', 'service_variables.id')

app/Http/Routes/AdminRoutes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function map(Router $router)
144144
]);
145145

146146
$router->post('/new/service-options', [
147-
'uses' => 'Admin\ServersController@postNewServerServiceOptions',
147+
'uses' => 'Admin\ServersController@postNewServerServiceOption',
148148
]);
149149

150150
$router->post('/new/option-details', [

app/Models/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function service()
253253
*/
254254
public function option()
255255
{
256-
return $this->belongsTo(ServiceOptions::class);
256+
return $this->belongsTo(ServiceOption::class);
257257
}
258258

259259
/**

app/Models/ServerVariables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ class ServerVariables extends Model
5959
*/
6060
public function variable()
6161
{
62-
return $this->belongsTo(ServiceVariables::class, 'variable_id');
62+
return $this->belongsTo(ServiceVariable::class, 'variable_id');
6363
}
6464
}

app/Models/Service.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Service extends Model
4949
*/
5050
public function options()
5151
{
52-
return $this->hasMany(ServiceOptions::class);
52+
return $this->hasMany(ServiceOption::class);
5353
}
5454

5555
/**
@@ -60,7 +60,7 @@ public function options()
6060
public function packs()
6161
{
6262
return $this->hasManyThrough(
63-
'Pterodactyl\Models\ServicePack', 'Pterodactyl\Models\ServiceOptions',
63+
'Pterodactyl\Models\ServicePack', 'Pterodactyl\Models\ServiceOption',
6464
'service_id', 'option_id'
6565
);
6666
}

app/Models/ServiceOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
use Illuminate\Database\Eloquent\Model;
2828

29-
class ServiceOptions extends Model
29+
class ServiceOption extends Model
3030
{
3131
/**
3232
* The table associated with the model.
@@ -100,7 +100,7 @@ public function servers()
100100
*/
101101
public function variables()
102102
{
103-
return $this->hasMany(ServiceVariables::class, 'option_id');
103+
return $this->hasMany(ServiceVariable::class, 'option_id');
104104
}
105105

106106
/**

app/Models/ServicePack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ class ServicePack extends Model
6464
*/
6565
public function option()
6666
{
67-
return $this->belongsTo(ServiceOptions::class);
67+
return $this->belongsTo(ServiceOption::class);
6868
}
6969
}

0 commit comments

Comments
 (0)