|
14 | 14 | use Pterodactyl\Models\User; |
15 | 15 | use Pterodactyl\Models\Mount; |
16 | 16 | use Pterodactyl\Models\Server; |
| 17 | +use Pterodactyl\Models\MountServer; |
17 | 18 | use Prologue\Alerts\AlertsMessageBag; |
18 | 19 | use GuzzleHttp\Exception\RequestException; |
19 | 20 | use Pterodactyl\Exceptions\DisplayException; |
@@ -419,17 +420,21 @@ public function deleteDatabase($server, $database) |
419 | 420 | * |
420 | 421 | * @param Server $server |
421 | 422 | * @param \Pterodactyl\Models\Mount $mount |
422 | | - * @return \Illuminate\Http\RedirectResponse |
423 | 423 | * |
424 | | - * @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException |
425 | | - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException |
| 424 | + * @return \Illuminate\Http\RedirectResponse |
| 425 | + * @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException|\Throwable |
426 | 426 | */ |
427 | 427 | public function addMount(Server $server, Mount $mount) |
428 | 428 | { |
429 | | - $server->mounts()->updateOrCreate([ |
| 429 | + /*$server->mounts()->updateOrCreate([ |
430 | 430 | 'mount_id' => $mount->id, |
431 | 431 | 'server_id' => $server->id, |
432 | | - ]); |
| 432 | + ]);*/ |
| 433 | + |
| 434 | + $mountServer = new MountServer; |
| 435 | + $mountServer->mount_id = $mount->id; |
| 436 | + $mountServer->server_id = $server->id; |
| 437 | + $mountServer->saveOrFail(); |
433 | 438 |
|
434 | 439 | $data = $this->serverConfigurationStructureService->handle($server); |
435 | 440 |
|
@@ -458,10 +463,7 @@ public function addMount(Server $server, Mount $mount) |
458 | 463 | */ |
459 | 464 | public function deleteMount(Server $server, Mount $mount) |
460 | 465 | { |
461 | | - $server->mounts() |
462 | | - ->where('mount_id', $mount->id) |
463 | | - ->where('server_id', $server->id) |
464 | | - ->delete(); |
| 466 | + MountServer::where('mount_id', $mount->id)->where('server_id', $server->id)->delete(); |
465 | 467 |
|
466 | 468 | $data = $this->serverConfigurationStructureService->handle($server); |
467 | 469 |
|
|
0 commit comments