2024-03-13 16:54:10 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\BlueprintFramework\Controllers;
|
|
|
|
|
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
2024-03-13 16:59:45 -04:00
|
|
|
use Pterodactyl\Http\Requests\Admin\AdminFormRequest;
|
2024-03-13 16:54:10 -04:00
|
|
|
|
|
|
|
class ExtensionConfigurationController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* BlueprintExtensionController constructor.
|
|
|
|
*/
|
|
|
|
public function __construct() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
|
|
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
|
|
|
*/
|
2024-03-13 16:59:45 -04:00
|
|
|
public function update(ExtensionConfigurationRequest $request): RedirectResponse
|
2024-03-13 16:54:10 -04:00
|
|
|
{
|
2024-03-19 11:07:10 -04:00
|
|
|
//foreach ($request->normalize() as $key => $value) { $this->settings->set('blueprint::extension.config/' . $key, $value); }
|
2024-03-13 16:54:10 -04:00
|
|
|
return redirect()->route('admin.extensions.'.$request->input('_identifier', 'blueprint').'.index');
|
|
|
|
}
|
2024-03-13 16:59:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
class ExtensionConfigurationRequest extends AdminFormRequest
|
|
|
|
{
|
|
|
|
public function rules(): array {
|
|
|
|
return [
|
|
|
|
'*' => 'nullable',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function attributes(): array {
|
|
|
|
return [
|
|
|
|
'*' => 'test',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|