mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
40 lines
754 B
PHP
40 lines
754 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Remote;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Arr;
|
|
use Pterodactyl\Support\JsonValueGuard;
|
|
|
|
class ReportBackupRestoreRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return ValidationRules
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'successful' => ['required', 'boolean'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array{successful: bool}
|
|
*/
|
|
public function payload(): array
|
|
{
|
|
$data = parent::validated();
|
|
|
|
return [
|
|
'successful' => JsonValueGuard::boolean(Arr::get($data, 'successful')),
|
|
];
|
|
}
|
|
}
|