Replace egg repository

This commit is contained in:
Lance Pioch 2022-10-23 17:27:18 -04:00
parent 860b2d890b
commit 6e4f7f16c1
11 changed files with 54 additions and 206 deletions

View file

@ -9,7 +9,6 @@ use Illuminate\Http\RedirectResponse;
use Prologue\Alerts\AlertsMessageBag;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Contracts\Repository\EggRepositoryInterface;
use Pterodactyl\Services\Eggs\Variables\VariableUpdateService;
use Pterodactyl\Http\Requests\Admin\Egg\EggVariableFormRequest;
use Pterodactyl\Services\Eggs\Variables\VariableCreationService;
@ -24,7 +23,6 @@ class EggVariableController extends Controller
protected AlertsMessageBag $alert,
protected VariableCreationService $creationService,
protected VariableUpdateService $updateService,
protected EggRepositoryInterface $repository,
protected EggVariableRepositoryInterface $variableRepository,
protected ViewFactory $view
) {
@ -33,11 +31,10 @@ class EggVariableController extends Controller
/**
* Handle request to view the variables attached to an Egg.
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function view(int $egg): View
{
$egg = $this->repository->getWithVariables($egg);
$egg = Egg::with('variables')->findOrFail($egg);
return $this->view->make('admin.eggs.variables', ['egg' => $egg]);
}