c8faf64059
Bumps PTDL_v1 export images to PTDL_v2, updates the Minecraft specific eggs to use named images.
33 lines
907 B
PHP
33 lines
907 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Settings;
|
|
|
|
use Webmozart\Assert\Assert;
|
|
use Pterodactyl\Models\Server;
|
|
use Illuminate\Validation\Rule;
|
|
use Pterodactyl\Models\Permission;
|
|
use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
|
|
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
|
|
|
class SetDockerImageRequest extends ClientApiRequest implements ClientPermissionsRequest
|
|
{
|
|
public function permission(): string
|
|
{
|
|
return Permission::ACTION_STARTUP_DOCKER_IMAGE;
|
|
}
|
|
|
|
/**
|
|
* @return array[]
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
/** @var \Pterodactyl\Models\Server $server */
|
|
$server = $this->route()->parameter('server');
|
|
|
|
Assert::isInstanceOf($server, Server::class);
|
|
|
|
return [
|
|
'docker_image' => ['required', 'string', Rule::in(array_values($server->egg->docker_images))],
|
|
];
|
|
}
|
|
}
|