Add FiveM resources and templates for documentation and code snippets
- Introduced a new code snippets resource for common FiveM patterns in Lua and JavaScript. - Added a framework comparison document outlining Standalone, ESX, and QBCore features. - Created search results view for FiveM documentation queries. - Developed client and server template scripts for ESX and QBCore frameworks. - Implemented NUI templates including HTML, CSS, and JavaScript for user interfaces. - Established routes for documentation and console commands. - Added tests for various features including documentation routes and tool functionalities. - Configured Vite for asset management with Laravel. - Updated .gitignore files for storage and framework directories.
This commit is contained in:
112 files changed
+51106
No files matched your search
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mcp\Prompts;
|
||||
|
||||
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
||||
use Laravel\Mcp\Request;
|
||||
use Laravel\Mcp\Response;
|
||||
use Laravel\Mcp\Server\Attributes\Description;
|
||||
use Laravel\Mcp\Server\Prompt;
|
||||
|
||||
#[Description('Create a new FiveM resource with framework and language selection')]
|
||||
class CreateNewResource extends Prompt
|
||||
{
|
||||
public function handle(Request $request): Response
|
||||
{
|
||||
$resourceName = $request->get('resource_name', 'my-resource');
|
||||
$framework = $request->get('framework', 'standalone');
|
||||
$language = $request->get('language', 'lua');
|
||||
|
||||
return Response::prompt(sprintf(
|
||||
"Create a new FiveM resource called '%s' with the following requirements:\n\n" .
|
||||
"Framework: %s\n" .
|
||||
"Language: %s\n\n" .
|
||||
"Please:\n" .
|
||||
"1. Generate a complete fxmanifest.lua\n" .
|
||||
"2. Create a config file with common settings\n" .
|
||||
"3. Generate boilerplate client and server files\n" .
|
||||
"4. Include proper error handling and validation\n" .
|
||||
"5. Follow FiveM best practices\n" .
|
||||
"6. Add helpful comments explaining the code structure\n\n" .
|
||||
"Use the available tools to generate the manifest and boilerplate code.",
|
||||
$resourceName,
|
||||
$framework,
|
||||
$language
|
||||
));
|
||||
}
|
||||
|
||||
public function schema(JsonSchema $schema): array
|
||||
{
|
||||
return [
|
||||
'resource_name' => $schema->string()
|
||||
->description('Name of the resource to create')
|
||||
->default('my-resource'),
|
||||
'framework' => $schema->enum(['standalone', 'esx', 'qbcore'])
|
||||
->description('Framework to use')
|
||||
->default('standalone'),
|
||||
'language' => $schema->enum(['lua', 'js'])
|
||||
->description('Scripting language')
|
||||
->default('lua'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user