### Display Blueprint Installation Info Source: https://blueprint.zip/docs/cli/commands Prints information about your Blueprint installation in a neofetch-like format. ```bash # Usage blueprint -info|-f # Example blueprint -info ``` -------------------------------- ### Example Console.yml Configuration Source: https://blueprint.zip/docs/configs/consoleyml An example of a valid Console.yml configuration showcasing multiple command definitions with different intervals, including human-readable and cron-syntax. ```yaml - { Signature: "foo", Description: "returns bar", Path: "foobar.php", Interval: "" } - { Signature: "byte", Description: "[ ^ ^]", Path: "byte.php", Interval: "everyMinute" } - { Signature: "hello", Description: "prints 'hello world'", Path: "folder/hello.php", Interval: "*/5 * * * *" } ``` -------------------------------- ### Get Blueprint Version Source: https://blueprint.zip/docs/cli/commands Returns the currently installed Blueprint version. ```bash # Usage blueprint -version|-v # Example blueprint -version ``` -------------------------------- ### Install Blueprint Extension Source: https://blueprint.zip/docs/cli/commands Use this command to install or update one or multiple extensions. Blueprint automatically determines if an update is needed. ```bash # Usage blueprint -install|-add|-i [..name] # Example blueprint -install modpackinstaller minecraftplayermanager ``` -------------------------------- ### Build Blueprint Extension Source: https://blueprint.zip/docs/cli/commands Installs or updates your extension development files, similar to installing a packaged extension. ```bash # Usage blueprint -build|-b # Example blueprint -build ``` -------------------------------- ### Console.yml Configuration Example Source: https://blueprint.zip/docs/configs/consoleyml This snippet shows the basic structure and all supported configuration options for Console.yml. Use this as a template for your own configurations. ```yaml - { Signature: '', Description: '', Path: '', Interval: '' } ``` -------------------------------- ### Rerun Blueprint Installation Script Source: https://blueprint.zip/docs/cli/commands Executes the Blueprint installation script again, useful for re-initializing or fixing installation issues. ```bash # Usage blueprint -rerun-install # Example blueprint -rerun-install ``` -------------------------------- ### Get All Installed Extensions Source: https://blueprint.zip/docs/lib/methods Retrieves a list of all installed extension identifiers. This is useful for auditing or iterating over available extensions. ```php $installedExtensions = $blueprint->extensions(); // Returns array like ['myextension', 'minecraftplayermanager', 'nebula'] ``` -------------------------------- ### Get all installed extensions Source: https://blueprint.zip/docs/lib/methods The `extensions()` method returns an array of all installed extension identifiers. ```APIDOC ## Get all installed extensions ### Description The `extensions()` method returns an array of all installed extension identifiers. ### Method ```php $blueprint->extensions() ``` ### Response #### Success Response - Returns an array of strings, where each string is an extension identifier. ### Response Example ```json ["myextension", "minecraftplayermanager", "nebula"] ``` ``` -------------------------------- ### Example Components.yml Configuration Source: https://blueprint.zip/docs/configs/componentsyml This snippet shows a basic Components.yml configuration with navigation and account overview components defined. It demonstrates how to specify components for different areas like navigation bars and routes. ```yaml Navigation: NavigationBar: BeforeNavigation: 'HelloWorldComponent' Routes: - { Name: 'My Extension', Path: '/myextension', Type: 'server', Component: 'sections/MyExtensionSection', AdminOnly: 'false' } - { Name: 'Security keys', Path: '/securitykeys', Type: 'account', Component: 'sections/SecurityKeysSection', AdminOnly: 'false' } Account: Overview: BeforeContent: 'UserGreeterComponent' AfterContent: 'HelloWorldComponent' #you can use the same component in multiple places! ``` -------------------------------- ### Extension Methods Source: https://blueprint.zip/docs/lib/methods Check if an extension is installed and query its configuration. ```APIDOC ## extension Checks if a specific extension is installed by its identifier. ### Parameters #### Path Parameters - **$identifier** (string) - Required - Extension identifier ### Request Example ```php $isInstalled = $blueprint->extension('myextension'); // Returns true if installed, false otherwise if($isInstalled) { echo("myextension is installed!"); } else { echo("myextension isn't installed :("); } ``` ``` -------------------------------- ### Get All Extension Configurations Source: https://blueprint.zip/docs/lib/methods Retrieves a Laravel Collection containing the configurations for all currently installed extensions. This provides a comprehensive overview of extension settings. ```php $allConfigs = $blueprint->extensionsConfigs(); // Returns Collection of config arrays ``` -------------------------------- ### Get all extension configurations Source: https://blueprint.zip/docs/lib/methods The `extensionsConfigs()` method returns a Laravel Collection containing configurations for all installed extensions. ```APIDOC ## Get all extension configurations ### Description The `extensionsConfigs()` method returns a Laravel Collection containing configurations for all installed extensions. ### Method ```php $blueprint->extensionsConfigs() ``` ### Response #### Success Response - Returns a Laravel Collection of configuration arrays for all installed extensions. ### Response Example ```json [ { "extension": "myextension", "config": { "setting1": "value1" } }, { "extension": "another", "config": { "settingA": "valueA" } } ] ``` ``` -------------------------------- ### Version Checker Command (Simplified) Source: https://blueprint.zip/docs/configs/consoleyml A simplified example of a version checker command, illustrating differences from standard Artisan commands. Blueprint handles boilerplate like namespace and class definition. ```php blueprint->dbGet('blueprint', 'internal:version:latest'); if ($latest == '') { $this->call('bp:version:cache'); $latest = $this->blueprint->dbGet('blueprint', 'internal:version:latest'); } echo $latest; return $latest; - } - } ``` -------------------------------- ### Get Specific Extension Configuration Source: https://blueprint.zip/docs/lib/methods Fetches the configuration for a single, specified extension. Returns null if the extension is not found. ```php $config = $blueprint->extensionConfig('myextension'); // Returns array with extension config, or null if extension doesn't exist ``` -------------------------------- ### Check if an Extension is Installed Source: https://blueprint.zip/docs/lib/methods Verify if a specific extension is installed using its identifier with the `extension()` method. It returns a boolean value. ```php $isInstalled = $blueprint->extension('myextension'); // Returns true if installed, false otherwise if($isInstalled) { echo("myextension is installed!"); } else { echo("myextension isn't installed :("); } ``` -------------------------------- ### Basic Web Route Definition Source: https://blueprint.zip/docs/concepts/routing Define a simple GET route in `web.php` that returns a string. This route will be accessible under `/extensions/{identifier}/foo`. ```php { // Return the component's contents return ( <> {/* Add a paragraph element */}
this is my first component!
> ) } ``` -------------------------------- ### PHP Script for a Simple Command Source: https://blueprint.zip/docs/configs/consoleyml The PHP script executed by the Artisan command defined in Console.yml. This example simply outputs 'bar'. ```php extensionConfig($identifier) ``` ### Parameters #### Path Parameters - **$identifier** (string) - Required - Extension identifier ### Response #### Success Response - Returns an array containing the extension's configuration, or null if the extension does not exist. ### Response Example ```json { "setting1": "value1", "setting2": "value2" } ``` ``` -------------------------------- ### Define Target Blueprint Version Source: https://blueprint.zip/docs/configs/confyml Indicates the Blueprint version the extension is designed for. Blueprint warns users if this doesn't match the current version but still allows installation. ```yaml info: # when this doesn't match a panel's blueprint # version, they may see a warning about it target: 'beta-2025-09' ``` -------------------------------- ### Handle Failed File Writes Source: https://blueprint.zip/docs/concepts/filesystem The `put` method returns `false` if a write operation fails, for example, due to insufficient permissions. Check the return value to handle potential errors. ```php // Create public file 'hello.txt' with content 'hi!!' if (Storage::disk('{fs}')->put('hello.txt', 'hi!!')) { // Successfully created file.. } else { // Could not create file.. } ``` -------------------------------- ### Add Route for the View Controller Source: https://blueprint.zip/docs/concepts/routing Register a new GET route in your web router file that points to the controller method responsible for rendering the view. This makes the view accessible via a URL. ```php ('foo.txt'); ``` ```php // Get and decode the contents of 'config.json' $config = Storage::disk('{fs}')->json('config.json'); ``` -------------------------------- ### Revert String Replacement with sed Source: https://blueprint.zip/docs/concepts/scripts Use `sed` to revert a string replacement, typically done during extension removal to undo changes made by the install script. ```bash # Replaces foo back to bar in the foo.txt file sed -i "s/bar/foo/g" $PTERODACTYL_DIRECTORY/foo.txt ``` -------------------------------- ### Get a Single Database Record Source: https://blueprint.zip/docs/lib/methods Retrieve a single record from a specified database table using `dbGet()`. An optional default value can be provided if the record is null. ```php // Get a record from the database $foo = $blueprint->dbGet('{identifier}', 'foo'); // Print the record's value echo($foo); ``` -------------------------------- ### Define Extension Identifier Source: https://blueprint.zip/docs/configs/confyml Specifies a unique identifier for your extension, used for file names and routing. This should only contain lowercase 'a-z' characters and is difficult to change after installation. ```yaml info: # the unique identifier of your extension, # you can't really (easily) change this later identifier: 'myextension' ``` -------------------------------- ### Get Multiple Database Records Source: https://blueprint.zip/docs/lib/methods Fetch multiple records from a database table using `dbGetMany()`. If no specific records are requested, all records for the table are returned. Data is automatically unserialized. ```php // Get specific records $data = $blueprint->dbGetMany('{identifier}', ['foo', 'bar', 'baz']); // Get all records for a table $allData = $blueprint->dbGetMany('{identifier}'); ``` -------------------------------- ### Display Blueprint CLI Help Source: https://blueprint.zip/docs/cli/commands Displays the Command Line Interface's help menu, providing information on available commands and their usage. ```bash # Usage blueprint -help|-h # Example blueprint -help ``` -------------------------------- ### Create File in Extension's Public Directory Source: https://blueprint.zip/docs/concepts/placeholders This script demonstrates using the '{root/public}' placeholder to specify a path within the extension's public directory for creating a file. The file 'foo.txt' will be created with the content 'bar'. ```bash #!/bin/bash touch "{root/public}/foo.txt" echo "bar" > "{root/public}/foo.txt" ``` -------------------------------- ### Initialize Blueprint Extension Development Source: https://blueprint.zip/docs/cli/commands Initializes Blueprint extension development files. This command generates and prefills development files in `.blueprint/dev` based on a template. ```bash # Usage blueprint -init|-I # Example blueprint -init ``` -------------------------------- ### Export Blueprint Extension Source: https://blueprint.zip/docs/cli/commands Packages your extension. Optionally, it can generate a temporary download link using the `expose` argument. ```bash # Usage blueprint -export|-e ('expose') # Example blueprint -export blueprint -export expose ``` -------------------------------- ### Full Components.yml Reference Configuration Source: https://blueprint.zip/docs/configs/componentsyml This is a comprehensive reference for Components.yml, listing all supported areas, categories, and configuration options. Use this to understand the full scope of customization available. ```yaml Navigation: NavigationBar: BeforeNavigation: '' AdditionalItems: '' AfterNavigation: '' SubNavigation: BeforeSubNavigation: '' AdditionalServerItems: '' AdditionalAccountItems: '' AfterSubNavigation: '' Routes: - { Name: '', Path: '', Type: '', Component: '', AdminOnly: '' } Dashboard: Global: BeforeSection: '' AfterSection: '' Serverlist: BeforeContent: '' AfterContent: '' ServerRow: BeforeEntryName: '' AfterEntryName: '' BeforeEntryDescription: '' AfterEntryDescription: '' ResourceLimits: '' Authentication: Container: BeforeContent: '' AfterContent: '' Account: Overview: BeforeContent: '' AfterContent: '' API: BeforeContent: '' AfterContent: '' SSH: BeforeContent: '' AfterContent: '' Server: Terminal: BeforeContent: '' AdditionalPowerButtons: '' BeforeInformation: '' AfterInformation: '' CommandRow: '' AfterContent: '' Files: Browse: BeforeContent: '' FileButtons: '' DropdownItems: '' AfterContent: '' Edit: BeforeEdit: '' AfterEdit: '' Databases: BeforeContent: '' AfterContent: '' Schedules: List: BeforeContent: '' AfterContent: '' Edit: BeforeEdit: '' AfterEdit: '' Users: BeforeContent: '' AfterContent: '' Backups: BeforeContent: '' DropdownItems: '' AfterContent: '' Network: BeforeContent: '' AfterContent: '' Startup: BeforeContent: '' AfterContent: '' Settings: BeforeContent: '' AfterContent: '' ``` -------------------------------- ### Create Directories Source: https://blueprint.zip/docs/concepts/filesystem The `makeDirectory` method creates a specified directory, including any necessary parent directories if they do not exist. This ensures a structured file organization. ```php // Creates directory 'foo' Storage::disk('{fs}')->makeDirectory("foo"); // Creates directory 'foo' and it's parent 'bar' if it does not exist Storage::disk('{fs}')->makeDirectory("bar/foo"); ``` -------------------------------- ### Create a Basic Blade View Source: https://blueprint.zip/docs/concepts/routing Create a simple Blade view file (e.g., `fizz.blade.php`) within the configured views directory. This file contains the HTML structure and content to be rendered. ```htmlbuzz!
``` -------------------------------- ### List Files and Directories Source: https://blueprint.zip/docs/concepts/filesystem Use the `files` and `directories` methods to retrieve arrays of all files or subdirectories within a specified directory. This helps in managing and iterating over directory contents. ```php use Illuminate\Support\Facades\Storage; // Array of all files in 'parent_directory' $files = Storage::disk('{fs}')->files('parent_directory'); // Array of all folders in 'parent_directory' $directories = Storage::disk('{fs}')->directories('parent_directory'); ``` -------------------------------- ### Create a Controller for Routing Source: https://blueprint.zip/docs/concepts/routing Define a controller class in the specified `requests.app` directory. This controller will handle incoming requests for specific routes. ```php alert('info', 'The quick brown fox jumps over the lazy dog'); $blueprint->alert('warning', 'The lazy dog woke up'); $blueprint->alert('danger', 'The lazy dog is chasing the quick brown fox'); $blueprint->alert('success', 'The quick brown fox got away'); ``` -------------------------------- ### Copy and Move Files Source: https://blueprint.zip/docs/concepts/filesystem Utilize the `copy` method to duplicate files and the `move` method to relocate them within the filesystem. These operations are typically performed on private files. ```php // Copy 'foo.txt' to 'foo2.txt' Storage::disk('{fs/private}')->copy('foo.txt', 'foo2.txt'); // Move 'old.txt' to 'new.txt' Storage::disk('{fs/private}')->move('old.txt', 'new.txt'); ``` -------------------------------- ### Configure Client API Routes Source: https://blueprint.zip/docs/configs/confyml Specify the path to your custom client route handler file. These routes extend the client API and are prefixed with `/api/client/extensions/{identifier}/`. ```yaml requests: routers: # add custom client routes # (aka extend the client api) client: 'path/to/clientroutes.php' ``` -------------------------------- ### Full conf.yml Reference Template Source: https://blueprint.zip/docs/configs/confyml A comprehensive template listing all supported configuration values in conf.yml for Blueprint projects, including info, admin, dashboard, data, requests, and database sections. ```yaml info: name: '' identifier: '' description: '' flags: '' version: '' target: '' author: '' icon: '' website: '' admin: view: '' controller: '' css: '' wrapper: '' dashboard: css: '' wrapper: '' components: '' data: directory: '' public: '' console: '' requests: views: '' app: '' routers: application: '' client: '' web: '' database: migrations: '' ``` -------------------------------- ### Configure Web Routes Source: https://blueprint.zip/docs/configs/confyml Define the path to your custom web route handler file. These routes are standard and prefixed with `/extensions/{identifier}/`. ```yaml requests: routers: # add custom web routes # (aka add custom routes prefixed with # /extensions/myextension) web: 'path/to/webroutes.php' ``` -------------------------------- ### Configure Database Migrations Directory Source: https://blueprint.zip/docs/configs/confyml Set the directory containing your database migration files. Blueprint will copy these to Laravel's `database/migrations/` and run them. ```yaml database: # directory with database migrations migrations: 'path/to/directory' ``` -------------------------------- ### Configure Application Logic Directory Source: https://blueprint.zip/docs/configs/confyml Define the directory for application logic and controllers. This directory is symlinked to app/BlueprintFramework/Extensions/{identifier} and accessible as {appcontext}\MyClassName. ```yaml requests: # add additional php files in here! app: 'path/to/directory' ``` -------------------------------- ### Define Extension Icon Source: https://blueprint.zip/docs/configs/confyml Sets the path to the extension's icon, which can be in various image formats. A placeholder is used if this is omitted. ```yaml info: # icons can be jpg/jpeg, svg, png, gif or webp!! icon: 'path/to/icon.png' ``` -------------------------------- ### Configure Admin Wrapper Path Source: https://blueprint.zip/docs/configs/confyml Specify the path to a Blade view for extending the admin panel layout. This view is copied to resources/views/blueprint/admin/wrappers/{identifier}.blade.php. ```yaml admin: # some additional html/php added to the end of # the admin panel wrapper: 'path/to/wrapper.blade.php' ``` -------------------------------- ### Configure Console Commands Directory Source: https://blueprint.zip/docs/configs/confyml Set the directory path for Artisan commands and scheduling functionality. Files here are copied to app/Console/Commands/BlueprintFramework/Extensions/{identifier}/. ```yaml data: # directory for console commands (Console.yml) console: 'path/to/directory' ``` -------------------------------- ### Configure Application Router Path Source: https://blueprint.zip/docs/configs/confyml Specify the path to a custom application routes file. These routes are copied to routes/blueprint/application/{identifier}.php and prefixed by /api/application/extensions/{identifier}/. ```yaml requests: routers: # add custom application routes # (aka extend the admin/application api) application: 'path/to/approutes.php' ``` -------------------------------- ### Controller to Render a Blade View Source: https://blueprint.zip/docs/concepts/routing Implement a controller that uses `ViewFactory` to render a specified Blade view. Ensure the view name is correctly prefixed with the view context provided by Blueprint. ```php view->make('{viewcontext}.fizz'); } } ``` -------------------------------- ### Generate Public File URL Source: https://blueprint.zip/docs/concepts/filesystem Blueprint provides placeholders to construct the public URL for files stored in the `{fs}` filesystem. This allows direct access to publicly stored assets. ```php Storage::disk('{fs}')->put('dog.txt', 'woof'); $url = "{webroot/fs}/dog.txt"; ``` -------------------------------- ### Watch for Changes and Rebuild Extension Source: https://blueprint.zip/docs/cli/commands Monitors extension development files for changes and automatically rebuilds them. ```bash # Usage blueprint -watch # Example blueprint -watch ``` -------------------------------- ### Prepend and Append File Content Source: https://blueprint.zip/docs/concepts/filesystem Modify files by adding content to the beginning using `prepend` or to the end using `append`. These methods are useful for logging or updating file content incrementally. ```php // Write 'prepended text' to the start of 'example.log' Storage::disk('{fs/private}')->prepend('example.log', 'prepended text'); // Write 'appended text' to the end of 'example.log' Storage::disk('{fs/private}')->append('example.log', 'appended text'); ``` -------------------------------- ### Configure Dashboard Wrapper Path Source: https://blueprint.zip/docs/configs/confyml Specify the path to a Blade view for extending the client dashboard layout. This view is copied to resources/views/blueprint/dashboard/wrappers/{identifier}.blade.php. ```yaml dashboard: # html/php added to the end of the frontend page, # outside of the react bundle wrapper: 'path/to/wrapper.blade.php' ``` -------------------------------- ### Import Stylesheet Source: https://blueprint.zip/docs/lib/methods Generates an HTML link tag for a stylesheet, including cache-busting parameters. This method is only available in admin views. ```php echo $blueprint->importStylesheet('{webroot/public}/style.css'); // Outputs: ``` -------------------------------- ### Configure Main Router File Source: https://blueprint.zip/docs/configs/confyml Specify the main Laravel router file for handling web requests. If only this option is provided, it defaults to the web router. ```yaml requests: # add a custom (web) routes file routers: 'path/to/webroutes.php' ``` -------------------------------- ### Configure Specific Router Files Source: https://blueprint.zip/docs/configs/confyml Define specific router files for application, client, and web routes, providing more granular control over request routing. ```yaml requests: routers: application: 'path/to/approutes.php' client: 'path/to/clientroutes.php' web: 'path/to/webroutes.php' ``` -------------------------------- ### Store Public and Private Files Source: https://blueprint.zip/docs/concepts/filesystem Use the `put` method to store files. Files written to `{fs}` are public and accessible via a URL, while files written to `{fs/private}` are stored in the extension's private directory. ```php use Illuminate\Support\Facades\Storage; // Create public file 'foo.txt' with content 'bar' Storage::disk('{fs}')->put('foo.txt', 'bar'); // Create private file 'bar.txt' with content 'foo' Storage::disk('{fs/private}')->put('bar.txt', 'foo'); ``` -------------------------------- ### Configure Views Directory Source: https://blueprint.zip/docs/configs/confyml Specify the directory containing additional Blade view files. These are symlinked to resources/views/blueprint/extensions/{identifier} and accessible via {viewcontext}.my-view-name. ```yaml requests: # directory where you can put uncategorized # blade views views: 'path/to/directory' ``` -------------------------------- ### Bind Route to Controller Method Source: https://blueprint.zip/docs/concepts/routing Update your `web.php` file to import the controller and bind a route to a specific controller method. This directs requests to the controller for handling. ```php exists('image.jpg')) { // File 'image.jpg' exists on filesystem } else { // File 'image.jpg' does not exist on filesystem } ``` -------------------------------- ### Import script Source: https://blueprint.zip/docs/lib/methods The `importScript()` method generates an HTML script tag with cache-busting parameters. Only available in admin views. ```APIDOC ## Import script ### Description The `importScript()` method generates an HTML script tag with cache-busting parameters. Only available in admin views. ### Method ```php $blueprint->importScript($url) ``` ### Parameters #### Path Parameters - **$url** (string) - Required - Script URL ### Response #### Success Response - Outputs an HTML script tag for the script with a cache-busting query parameter. ### Response Example ```html ``` ``` -------------------------------- ### Define Admin Controller Path Source: https://blueprint.zip/docs/configs/confyml Sets the path to a custom admin controller. If not provided, Blueprint uses a default controller. Custom controllers are copied to a specific application directory. ```yaml admin: # when kept empty, blueprint will use a basic # built-in controller controller: 'path/to/controller.php' ``` -------------------------------- ### Configure Controller Directory in conf.yml Source: https://blueprint.zip/docs/concepts/routing Set the `requests.app` bind in `conf.yml` to specify the directory where your controllers will reside. This directory is automatically corrected by Blueprint. ```yaml requests: app: 'app' # << the directory for your controllers to live in routers: web: 'web.php' # ^^ the custom web router you created earlier ``` -------------------------------- ### Embed Image using Webroot Placeholder Source: https://blueprint.zip/docs/concepts/placeholders This HTML snippet shows how to use the '{webroot/public}' placeholder to reference an image located in the extension's public directory. The image will be served from the website's root URL. ```html
```
--------------------------------
### Check Extension Target Version
Source: https://blueprint.zip/docs/concepts/placeholders
Use this snippet to conditionally display a warning if the user's Blueprint version does not match the extension's target version. It utilizes the `{is_target}` and `{target}` placeholders.
```blade
@if("{is_target}" != "true")