#[Description('Look up QBCore configuration options and settings. Returns information about core config, player defaults, server settings, and framework options.')]
classGetQBCoreConfigextendsTool
{
/**
* Handle the tool request.
*/
publicfunctionhandle(Request$request):Response
{
$configType=$request->get('config_type');
$language=$request->get('language','lua');
$config=$this->findConfigType($configType);
if(!$config){
returnResponse::text(sprintf("QBCore config '%s' not found. Available types: Player, Framework, Database, Callbacks, Database, Features",$configType));
'lua_example'=>"-- Database configuration is typically in environment variables\n-- Access through resource config if exposed\nprint('Database configuration is set in server.cfg or environment variables')",
'js_example'=>"// Database configuration is typically in environment variables\n// Access through resource config if exposed\nconsole.log('Database configuration is set in server.cfg or environment variables');",
],
'Callbacks'=>[
'category'=>'Callbacks',
'description'=>'Server-side callbacks that resources can register to respond to client requests.',
'location'=>'qb-core/server/callbacks.lua',
'config_options'=>[
['name'=>'RegisterCallback','type'=>'function','description'=>'Register a server callback that client scripts can call'],
['name'=>'TriggerCallback','type'=>'function','description'=>'Trigger a callback from client to server with response'],
],
'lua_example'=>"-- Server-side callback registration\nQBCore.Functions.CreateCallback('myResource:getData', function(source, cb, data)\n -- Process data from client\n cb({success = true, message = 'Data received'})\nend)\n\n-- Client-side callback usage\nQBCore.Functions.TriggerCallback('myResource:getData', function(result)\n print('Server response: ' .. result.message)\nend, myData)",
'js_example'=>"// Server-side callback registration\nQBCore.Functions.CreateCallback('myResource:getData', (source, cb, data) => {\n // Process data from client\n cb({success: true, message: 'Data received'});\n});\n\n// Client-side callback usage\nQBCore.Functions.TriggerCallback('myResource:getData', (result) => {\n console.log(`Server response: \${result.message}`);\n}, myData);",
],
'Features'=>[
'category'=>'Features',
'description'=>'Framework feature flags and optional feature configurations.',
'location'=>'qb-core/config.lua',
'config_options'=>[
['name'=>'Encryption','type'=>'boolean','description'=>'Enable data encryption'],
['name'=>'Custom','type'=>'string','description'=>'Add custom rep types in config for your resources'],
],
'lua_example'=>"-- Add rep to player (types defined in config)\nPlayer.Functions.AddRep('selling', 10)\nPlayer.Functions.AddRep('heist', 5)\nPlayer.Functions.AddRep('cartheft', 15)\n\n-- Get current rep\nlocal sellingRep = Player.Functions.GetRep('selling')\nprint('Selling Rep: ' .. sellingRep)",
'js_example'=>"// Add rep to player (types defined in config)\nPlayer.Functions.AddRep('selling', 10);\nPlayer.Functions.AddRep('heist', 5);\nPlayer.Functions.AddRep('cartheft', 15);\n\n// Get current rep\nconst sellingRep = Player.Functions.GetRep('selling');\nconsole.log(`Selling Rep: \${sellingRep}`);",