#Correct web route
1 messages · Page 1 of 1 (latest)
Where did you get that route from?
I have tried multiple routes to make it work
One of them
Uh anyone?
try /extensions/adminauditlogs/log
requests.js:1
POST http://redacted/extensions/adminauditlogs/log 419 (unknown status)
how does your route look like
<?php
Route::post('/log', [Pterodactyl\Http\Controllers\Admin\adminauditlogsExtensionController::class, 'log'])
->name('admin.extensions.adminauditlogs.log');
Oh sh- i forgot to close the php tag
Oh
im so confused
why is your route name admin.extensions.adminauditlogs.log
wont question it
okay uhhh lets see
does your requests.js even send the request
I asummed that would make /log only work in only admin area
uhh no
👍 , that's the chrome console
you'll have to check if your user is admin yourself
probably through the route file or controller
do you have the log function in your controller
if (!$request->user() || !$request->user()->root_admin) {
return response()->json(['error' => 'Unauthorized'], 403);
}
this would do it?
i dunno
try just returning something without all that other logic
to see if it returns anything at all
Nope it's not
is there anything else in your controller that could be screwing stuff up
There's this
- what
this is not how controllers work mate
well specifically looking at $this->version
Ah yeah
I am supposed to use:
public function __construct(
private ViewFactory $view,
private BlueprintExtensionLibrary $blueprint,
private ConfigRepository $config,
private SettingsRepositoryInterface $settings,
){}
why are you making a variable for root and then just putting it as $rootPath
neither
sigh could you not use AI for everything
you can use it but dont just paste it in your code editor
<?php
namespace Pterodactyl\Http\Controllers\Admin\Extensions\adminauditlogs;
use Illuminate\Http\Request;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Extensions\Blueprint;
class adminauditlogsExtensionController extends Controller
{
protected Blueprint $blueprint;
protected string $version;
public function __construct(Blueprint $blueprint)
{
parent::__construct();
$this->blueprint = $blueprint;
$this->version = config('blueprint.version', 'undefined');
}
public function index(): View
{
return view('admin.extensions.adminauditlogs.admin', [
'blueprint' => $this->blueprint,
'version' => $this->version,
'root' => '/admin/extensions/adminauditlogs'
]);
}
public function log(Request $request)
{
return response()->json(['message' => 'Test response']);
}
}
This is the complete file
yeah this is ai slop
there is no Pterodactyl\Extensions\Blueprint
there is no config('blueprint.version')
Ah mb
refer to this for a proper controller bootstrap
I just let the AI do it this time unlike the subdomains domain manager one, MB
Gonna remake it
<?php
namespace Pterodactyl\Http\Controllers\Admin\Extensions\adminauditlogs;
use Illuminate\View\View;
use Illuminate\View\Factory as ViewFactory;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Admin\BlueprintAdminLibrary as BlueprintExtensionLibrary;
class adminauditlogsExtensionController extends Controller
{
public function __construct(
private ViewFactory $view,
private BlueprintExtensionLibrary $blueprint,
) {}
public function index(): View
{
return $this->view->make(
'admin.extensions.adminauditlogs.admin', [
'root' => "/admin/extensions/adminauditlogs",
'blueprint' => $this->blueprint,
]
);
}
public function log(Request $request): JsonResponse
{
return response()->json(['message' => 'Test response']);
}
}
This would do?
I'll take my time remaking it without AI this time
way better
well not quite actually
admin.extensions.adminauditlogs.admin should be admin.extensions.adminauditlogs.index
Uh, do you know how to remove the css in admin added by a blueprint extension
any reason for doing so?
I messed it up a bit
Happened few days ago (before subdomains manager was released), i was trying to make a admin theme and it i messed the css up
can't you just like uninstall the theme
Nope it's not working
The files got removed but the css didn't
ctrl shift r?