Add QBCore tools for player and shared data information

- Implement GetQBCorePlayers tool to retrieve player data structure, methods, events, and examples.
- Implement GetQBCoreSharedData tool to retrieve shared data types including items, jobs, gangs, vehicles, weapons, starter items, and utilities.
- Create corresponding Blade views for displaying player and shared data information.
- Add tests for GetQBCoreConfig, GetQBCorePlayers, and GetQBCoreSharedData tools to ensure correct functionality and response handling.
This commit is contained in:
Adrian Mejias committed 2026-03-01 14:51:22 -06:00
1 parent 2f8ebe2940
commit b4d3b3582c
14 files changed
+1157 -6

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
<?php
use App\Mcp\Tools\QBCore\GetQBCoreConfig;
use Laravel\Mcp\Request;
test('GetQBCoreConfig returns Player config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'Player', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Player');
expect((string) $response->content())->toContain('PlayerDefaults');
});
test('GetQBCoreConfig returns Framework config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'Framework', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Framework');
expect((string) $response->content())->toContain('Version');
});
test('GetQBCoreConfig returns Database config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'Database', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Database');
expect((string) $response->content())->toContain('Backend');
});
test('GetQBCoreConfig returns Callbacks config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'Callbacks', 'language' => 'js']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Callbacks');
expect((string) $response->content())->toContain('JavaScript Example');
});
test('GetQBCoreConfig returns Features config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'Features', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('Features');
});
test('GetQBCoreConfig returns RepTypes config', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'RepTypes', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('RepTypes');
expect((string) $response->content())->toContain('selling');
});
test('GetQBCoreConfig returns not found for invalid type', function () {
$tool = new GetQBCoreConfig;
$request = new Request(['config_type' => 'InvalidType', 'language' => 'lua']);
$response = $tool->handle($request);
expect((string) $response->content())->toContain('not found');
});