Blueprint projects
- Frontend
- Blueprint assignments
- Blueprint builders
- Blueprint general
- Blueprint how to
- Blueprint tools
- Backend
Builder UI
Introduction
In this section we show how you can alter the UI to support custom configuration.
Installation
Backend
- enable UI -> config/builders.php
percictence.driver=>DatabaseDriver::class - add ENV setting
BUILDERS_CONFIG_API_HOST=>https://fragrant-star-s1v5s6idv6z2.vapor-farm-d1.com/api<– default - add ENV setting
BUILDERS_CONFIG_API_KEY=> you can request one from the blueprint team.
Frontend Follow section UI pages (Read more)
Flow

- You can create configurations on the test server or locally.
- The config server is a separate project hosting the configuration of all projects
- You add configurations to a release to get them on accept or production
- While building the accept or production backend the configurations are downloaded to your project database
- After creating a release you get a release version the release version in the config/builders.php is used in step 4
- You see that nothing is saved in the test database. Only when you press the ‘Set local development’ button for a configuration.
Set local development
To make it possible to test every scenario on the testserver the configs are not downloaded with every build. You need to do it manually, go in the UI to a version and press the button set local development As result the config is downloaded from the config server and stored in the test database.
Command: Set release
Signature: blueprint:builder:set-release
Options
- wipe (default true) – remove al configurations from project database and replace it with configurations from release
- version (optional) – the release version, when not provided the release from the builders/config.php is used
Command: Set latest version
This command downloads only the latest versions of the configurations for your project.
php artisan blueprint:builders:set-latest-configs
Features
Release
The release version. When building a new version the command blueprint:builders:set-release will use this version to fetch the release configs from the config server.
Persistence
Here you can switch between DatabaseDriver (UI) or filesDriver
'driver' => DatabaseDriver::class,
// FilesDriver only: The location(s) the config can be found
'file_locations' => [
base_path('builder/configurations'),
],
Manipulators
Not every option is supporter inside the UI. To add certain option to an UI form you can register a manipulator.
This class should implement the ConfigurationManipulatorInterface or extend the abstract class ConfigurationManipulator
example
return [
'form_edit_release' => FormEditReleaseManipulator::class,
];
Available methods
parse()This method is called after retrieving the configuration from the databasegetConfig()-> returns the ConfigInterfacegetRawConfig()-> returns the config arraysetRawConfig()-> stores the array as raw configrebuild()-> parse the raw config array to the config interface again
Example raw config
parse(): ConfigInterface
{
$this->alterSomething()
$this->rebuild();
return $this->config;
}
Permission service
The service used to populate the permission dropdown. You can change the service or method to add custom permissions (like group permissions)
'ui' => [
'enabled' => env('BUILDERS_UI_ENABLED', false),
'permission_service' => [
'method' => 'list', // The method used to populate permissionService dropdown,
'class' => PermissionServiceContract::class,
'key' => 'name', // The key used in the list,
'value' => 'name', // The value used in the list,
],
],
configuration-config-server
Define the title of the form. (translation key) Config server host and api key. Normally configured in the env settings:
`BUILDERS_CONFIG_API_HOST`
`BUILDERS_CONFIG_API_KEY`
configuration-types
Not supported right now. Will be used in the future
classfinder-services
Often you need to select a backend service class. This dropdown is filled with the output of a class finder. With this configuration you can add or remove namespaces from the finder.
Example
'classfinder_service_namespaces' => [
'Emendis\Laravel\Complete\Module\Dxp\Domain\Services',
'Capturum\Auth\Domain\Services',
'Capturum\BaseData\Domain\Services',
'Capturum\File\Domain\Services',
'Capturum\HistoricalData\Domain\Services',
'Capturum\Localization\Domain\Services',
'Capturum\Property\Domain\Services',
'Capturum\Setting\Domain\Services',
'Capturum\Blueprint\Domain\Services',
],
ui-field-dependencies
The UI forms use dependencies to make the forms easier to use. When adding a new backend action sub type you need to see the action_class and method inputs.
Currently supported:
- edit action form
return [ 'edit_action' => [ 'action_class' => ['action.type:backend', 'action.type:backend_confirmation'], 'action_method' => ['action.type:backend', 'action.type:backend_confirmation'], 'confirmation_text' => ['action.type:backend_confirmation'], ] ];
Form templates
The form templates.
Form label positions
The label position options.
Default
- above
- before
Operators
The selectable filter operators.
Input types
The input types selectable in the form builder.
Input filter types
The filter types selectable in the list builder filter section.
Column types
The column types selectable in the list builder.
Action types
The different action types.
Default
- dot_menu
- on_row_click
- on_column_click
- bulk_action
- header_button
Action sub types (custom actions)
The filter sub types. This the place where you can add custom actions.
Default
- navigate
- open_popup
- open_sidebar
- backend
- backend_confirmation
Pagination types
The dropdown values for list settings pagination type.
Default
return [
[
'key' => 'paginated',
'label' => 'Paginated',
'value' => 'Paginated',
],
[
'key' => 'infinite',
'label' => 'Infinite',
'value' => 'Infinite',
],
];
Feature test
Trait BuildersTestHelpers contains some important helper methods to test your config.
With this method you download the latest config version from the config server to the test database.
addBuilderConfigToDatabase($key) // Add config to the test database
$this->listBuilderKey = 'cars'; // set the list key
$this->formBuilderKey = 'cars'; // set the form key
$this->builderConfigList(); // retrieve a list
$this->builderConfigForm(); // retrieve a form
$this->builderSourceList(); // retrieve a list source
$this->builderSourceForm($id); // retrieve a form source
$this->builderSubmitForm($data); // submit a form
$this->addContextToQuery($query); // Add context from the contextManager to the query string
$this->getSourceUrl($key, $id, $context, $meta) // build a source url
Example
/**
* A basic test example
*
* @return void
*/
public function testLoadConfig(): void
{
$this->addPermissionToRole('user.show');
$this->addBuilderConfigToDatabase('cars');
$this->listBuilderKey = 'cars';
$response = $this->builderConfigList();
$response->assertStatus(200);
}
Default
return [
[
'key' => 'paginated',
'label' => 'Paginated',
'value' => 'Paginated',
],
[
'key' => 'infinite',
'label' => 'Infinite',
'value' => 'Infinite',
],
];
Pages
There are couple of selectors you can use in your application to view some predefined lists
- To view list of configs you can use
<cpb-config-list></cpb-config-list> - To view list of releases you can use
<cpb-release-list></cpb-release-list> - To view list of configs that are in project database you can use
<cpb-project-database-config-list></cpb-project-database-config-list>