Correct web route
Hey, so what would be the correct web route, i am currently using /blueprint/web/adminauditlogs/log which says 405 (Method Not Allowed)
38 Replies
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
how does your route look like
Oh sh- i forgot to close the php tag
no thats not the issue
you don't have to close those
Oh
im so confused
why is your route name admin.extensions.adminauditlogs.log
wont question it
okay uhhh lets see
https://http.cat/419
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
Yup

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

1. 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 editorblueprint.zip
Powerful, fast and developer-friendly extension framework for Pterodactyl. Utilize extension APIs, inject HTML, modify stylesheets, package extensions and so much more.
<?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
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
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?
Did that multiple times alr