Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -1,19 +1,13 @@
<?php
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
*
* This software is licensed under the terms of the MIT license.
* https://opensource.org/licenses/MIT
*/
namespace Pterodactyl\Http\Controllers\Admin\Nests;
use Javascript;
use JavaScript;
use Illuminate\View\View;
use Pterodactyl\Models\Egg;
use Illuminate\Http\RedirectResponse;
use Prologue\Alerts\AlertsMessageBag;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Services\Eggs\EggUpdateService;
use Pterodactyl\Services\Eggs\EggCreationService;
@ -24,32 +18,18 @@ use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
class EggController extends Controller
{
protected $alert;
protected $creationService;
protected $deletionService;
protected $nestRepository;
protected $repository;
protected $updateService;
/**
* EggController constructor.
*/
public function __construct(
AlertsMessageBag $alert,
EggCreationService $creationService,
EggDeletionService $deletionService,
EggRepositoryInterface $repository,
EggUpdateService $updateService,
NestRepositoryInterface $nestRepository
protected AlertsMessageBag $alert,
protected EggCreationService $creationService,
protected EggDeletionService $deletionService,
protected EggRepositoryInterface $repository,
protected EggUpdateService $updateService,
protected NestRepositoryInterface $nestRepository,
protected ViewFactory $view
) {
$this->alert = $alert;
$this->creationService = $creationService;
$this->deletionService = $deletionService;
$this->nestRepository = $nestRepository;
$this->repository = $repository;
$this->updateService = $updateService;
}
/**
@ -60,9 +40,9 @@ class EggController extends Controller
public function create(): View
{
$nests = $this->nestRepository->getWithEggs();
Javascript::put(['nests' => $nests->keyBy('id')]);
JavaScript::put(['nests' => $nests->keyBy('id')]);
return view('admin.eggs.new', ['nests' => $nests]);
return $this->view->make('admin.eggs.new', ['nests' => $nests]);
}
/**
@ -87,7 +67,7 @@ class EggController extends Controller
*/
public function view(Egg $egg): View
{
return view('admin.eggs.view', [
return $this->view->make('admin.eggs.view', [
'egg' => $egg,
'images' => array_map(
fn ($key, $value) => $key === $value ? $value : "$key|$value",