forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStoreTaskRequest.php
More file actions
29 lines (25 loc) · 911 Bytes
/
StoreTaskRequest.php
File metadata and controls
29 lines (25 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Schedules;
use Pterodactyl\Models\Permission;
class StoreTaskRequest extends ViewScheduleRequest
{
/**
* Determine if the user is allowed to create a new task for this schedule. We simply
* check if they can modify a schedule to determine if they're able to do this. There
* are no task specific permissions.
*/
public function permission(): string
{
return Permission::ACTION_SCHEDULE_UPDATE;
}
public function rules(): array
{
return [
'action' => 'required|in:command,power,backup',
'payload' => 'required_unless:action,backup|string|nullable',
'time_offset' => 'required|numeric|min:0|max:900',
'sequence_id' => 'sometimes|required|numeric|min:1',
'continue_on_failure' => 'sometimes|required|boolean',
];
}
}