Path: blob/1.0-develop/app/Http/Requests/Api/Client/Servers/Files/WriteFileContentRequest.php
10278 views
<?php12namespace Pterodactyl\Http\Requests\Api\Client\Servers\Files;34use Pterodactyl\Models\Permission;5use Pterodactyl\Contracts\Http\ClientPermissionsRequest;6use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;78class WriteFileContentRequest extends ClientApiRequest implements ClientPermissionsRequest9{10/**11* Returns the permissions string indicating which permission should be used to12* validate that the authenticated user has permission to perform this action aganist13* the given resource (server).14*/15public function permission(): string16{17return Permission::ACTION_FILE_CREATE;18}1920/**21* There is no rule here for the file contents since we just use the body content22* on the request to set the file contents. If nothing is passed that is fine since23* it just means we want to set the file to be empty.24*/25public function rules(): array26{27return [28'file' => 'required|string',29];30}31}323334