2017-10-04 04:31:04 +00:00
|
|
|
<?php
|
|
|
|
|
2017-10-09 02:36:22 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Admin\Egg;
|
2017-10-04 04:31:04 +00:00
|
|
|
|
|
|
|
use Pterodactyl\Http\Requests\Admin\AdminFormRequest;
|
|
|
|
|
2017-10-09 02:36:22 +00:00
|
|
|
class EggImportFormRequest extends AdminFormRequest
|
2017-10-04 04:31:04 +00:00
|
|
|
{
|
2022-10-14 16:59:20 +00:00
|
|
|
public function rules(): array
|
2017-10-04 04:31:04 +00:00
|
|
|
{
|
2017-10-09 04:50:52 +00:00
|
|
|
$rules = [
|
2017-10-04 04:31:04 +00:00
|
|
|
'import_file' => 'bail|required|file|max:1000|mimetypes:application/json,text/plain',
|
|
|
|
];
|
2017-10-09 04:50:52 +00:00
|
|
|
|
|
|
|
if ($this->method() !== 'PUT') {
|
|
|
|
$rules['import_to_nest'] = 'bail|required|integer|exists:nests,id';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $rules;
|
2017-10-04 04:31:04 +00:00
|
|
|
}
|
|
|
|
}
|