Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -12,28 +12,19 @@ use Pterodactyl\Http\Requests\Api\Client\Servers\Files\UploadFileRequest;
|
|||
|
||||
class FileUploadController extends ClientApiController
|
||||
{
|
||||
/**
|
||||
* @var \Pterodactyl\Services\Nodes\NodeJWTService
|
||||
*/
|
||||
private $jwtService;
|
||||
|
||||
/**
|
||||
* FileUploadController constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
NodeJWTService $jwtService
|
||||
private NodeJWTService $jwtService
|
||||
) {
|
||||
parent::__construct();
|
||||
|
||||
$this->jwtService = $jwtService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a url where files can be uploaded to.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* Returns an url where files can be uploaded to.
|
||||
*/
|
||||
public function __invoke(UploadFileRequest $request, Server $server)
|
||||
public function __invoke(UploadFileRequest $request, Server $server): JsonResponse
|
||||
{
|
||||
return new JsonResponse([
|
||||
'object' => 'signed_url',
|
||||
|
@ -44,11 +35,9 @@ class FileUploadController extends ClientApiController
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a url where files can be uploaded to.
|
||||
*
|
||||
* @return string
|
||||
* Returns an url where files can be uploaded to.
|
||||
*/
|
||||
protected function getUploadUrl(Server $server, User $user)
|
||||
protected function getUploadUrl(Server $server, User $user): string
|
||||
{
|
||||
$token = $this->jwtService
|
||||
->setExpiresAt(CarbonImmutable::now()->addMinutes(15))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue