Skip to content

Plug-in reference ​

It is a list of functions and properties unique to each plug-in.
※ Custom tables or columns, reference of custom data, click here please refer to.
※ For the reference of plugins (CRUD pages), please refer to here.
※The classes of the admin library are described with the namespace of Exment v7.0.0 or later ("ExmentAdminCore\Admin").
If you are using v6.x or lower, please read them as "Encore\Admin". For details, please check Update procedure v7.0.0.

PluginBase / Plugin common class ​

Property ​
NameTypeDescription
pluginPluginEloquent instance of the plugin
pluginOptionsPluginOptionBaseClass instance that stores various properties of plugin (inherits PluginOptionBase)
useCustomOptionboolWhether to use plugin-specific settings. Initial value is false
  • In the past, properties were defined directly in the abstract class for each type of plug-in, but this method may cause a name conflict with the property defined by the user. Therefore, I decided to define the properties to be added in v4.2.2 or later in pluginOptions. You can access it with "$this->pluginOptions->{property name}". In addition, existing properties are still compatible and can still be used.

Function list ​

setCustomOptionForm ​

Defines plugin-specific settings.
For more information here, please refer to.

argument ​
NameTypeDescription
&$form\ExmentAdminCore\Admin\Formform instance of the admin library (exment-admin-core; laravel-admin in v6.x or earlier)
Return value ​

None

Example of use ​

Click here Please refer to.


PluginApiBase ​

An abstract class for plugins (APIs). If you are developing an API plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Controllers\ApiTrait
Property ​

None

Function list ​

getRouteUri ​

Get the endpoint of your own API.

argument ​
NameTypeDescription
$endpointstringThe endpoint URL to add. Initial value is null
Return value ​
TypeDescription
stringUnique API endpoint

PluginBatchBase ​

This is an abstract class of plug-in (batch). When developing a batch plug-in, inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
Property ​
PluginOptionBatch(Inheriting PluginOptionBase) ​
NameTypeDescription
command_optionsarrayCommand line arguments passed to the batch

Function list ​

execute ​

Submit the batch. Describe the processing you want to execute in this function.

argument ​

None

Return value ​

None


PluginButtonBase ​

An abstract class of plugins (buttons). If you develop a button plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginButtonTrait
  • trait Exceedone\Exment\Services\Plugin\PluginPageTrait
Property ​
PluginOptionBatch(Inheriting PluginOptionBase) ​
NameTypeDescription
custom_tableCustomTableInstance of custom table
custom_valueCustomValueEloquent instance of custom data for the page when the button is pressed on the details screen
selected_custom_valuesarrayAn array of Eloquent instances of the selected custom data when the button is pressed on the list screen

Function list ​

execute ​

Executes the process when the button is pressed. Please describe the process you want to execute in this function.

argument ​

None

Return value ​

None


render ​

Draw your own button. If you want to make it look special or embed a unique script, please describe it in this function.

argument ​

None

Return value ​
TypeDescription
string,RenderableOriginally drawn button

PluginDashboardBase ​

This is an abstract class of plugin (dashboard).
When developing a dashboard plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginPageTrait
Property ​
NameTypeDescription
dashboard_boxDashboardBoxPlaced dashboard Box instance

Function list ​

Returns the HTML of the header part of the dashboard BOX.
If you want to output HTML in the header part, please add the process to return HTML in this function in the inherited plugin file.

argument ​

None

Return value ​
TypeDescription
stringHTML of header part

body ​

Returns the HTML of the body part of the dashboard BOX.
If you want to output HTML to the body, please add the process to return HTML in this function in the inherited plugin file.

argument ​

None

Return value ​
TypeDescription
stringHTML of the body part

Returns the HTML of the footer part of dashboard BOX.
If you want to output HTML in the footer part, please add the process of returning HTML in this function in the inherited plug-in file.

argument ​

None

Return value ​
TypeDescription
stringHTML of footer part

getDashboardUri ​

Get the endpoint of each dashboard BOX.
When performing GET, POST, PUT, etc. in the dashboard BOX, use this function to get the URI part.

argument ​
NameTypeDescription
$endpointstringEndpoint URL to add. Initial value is null
Return value ​
TypeDescription
stringEndpoint to dashboard BOX

PluginDocumentBase ​

An abstract class for plugins (documents). When developing a document plugin, inherit this class. For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance
custom_valueCustomValueInstance of custom data
document_valueCustomValueInstance of output document data (can be referenced only in executed function)

Function list ​

(protected)executing ​

Function called before document output.
Use this function when you need to process individually, such as when you want to save values ​​to custom data before execution.

argument ​

None

Return value ​

None


(protected)executed ​

Function called after document output.
Use this function if you need to perform individual processing.

argument ​

None

Return value ​

None


PluginEventBase ​

An abstract class for plugins (events). If you develop an event plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginEventTrait
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance
custom_valueCustomValueEloquent instance of custom data (null for events not related to custom data)
isCreateboolWhether it is newly created data
isDeleteboolWhether it is deleted data
PluginOptionEvent(PluginOptionBaseを継承) ​
NameTypeDescription
is_modalboolWhether the page where the event occurred is a modal form
event_typePluginEventTypeEvent type
(loading, saving, saved, workflow_action_executing, workflow_action_executed, notify_executing, notify_executed)
page_typePluginPageTypeThe type of page where the event occurred
(list,create,edit,show)

Function list ​

execute ​

Describe the process you want to execute when an event occurs in this function.

argument ​

None

Return value ​

None


PluginExportBase ​

An abstract class for plugins (exports). If you develop an export plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance

Function list ​

defaultProvider ​

A function that sets the default export provider.

argument ​
NameTypeDescription
default_providerProviderBaseInstance of export provider
Return value ​
TypeDescription
PluginExportBaseInstance of this class

viewProvider ​

A function that sets the view provider.

argument ​
NameTypeDescription
view_providerProviderBaseInstance of view provider for export
Return value ​
TypeDescription
PluginExportBaseInstance of this class

execute ​

This function is called as an export process.
Please implement the export process in this function.

argument ​

None

Return value ​

None


PluginImportBase ​

It is an abstract class of plug-in (import). When developing an import plugin, inherit this class. For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance
fileFileFile imported from screen

Function list ​

execute ​

Function called as import processing. Add import processing to this function.

argument ​

None

Return value ​

None


PluginPageBase ​

An abstract class for plugins (pages). When developing a page plugin, inherit this class. For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginPageTrait
Property ​
NameTypeDescription
showHeaderboolWhether to display the icon and title in the header part at the top of the page. true: Display / false: Hide. Initial value is true.

Function list ​

getRouteUri ​

Get your own page endpoint.
When performing GET, POST, PUT, etc. on your own page, use this function to get the URI part.

argument ​
NameTypeDescription
$endpointstringEndpoint URL to add. Initial value is null
Return value ​
TypeDescription
stringEndpoint to dashboard BOX

PluginPublicBase ​

An abstract class of plugins (scripts, styles). If you develop script plugins or style plugins, please inherit this class.
For more information script or style, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
Property ​
NameTypeDescription
pluginPluginEloquent instance of the plugin

Function list ​

css ​

A function to get the path of CSS files.

argument ​
NameTypeDescription
$skipPathboolSet to true if css files are stored directly under the public folder. (Initial value is false)
Return value ​
TypeDescription
arrayArray of CSS file paths

js ​

A function to get the path of javascript files.

argument ​
NameTypeDescription
$skipPathboolSet to true if javascript files are stored directly under the public folder. (Initial value is false)
Return value ​
TypeDescription
arrayArray of javascript file paths

PluginValidatorBase ​

It is an abstract class of plugin (validation). When developing a validation plugin, inherit this class. For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance
original_valueCustomValueBefore change instance of custom data
input_valuearrayAssociative array storing screen input values (key: column name, value: input value)
called_typeValidateCalledTypeCaller type
(form: form, import: import, api: API)
messagesarrayStores error messages
(key: column name, value: error message * array if there are multiple)

Function list ​

validate ​

Perform validation. Describe the processing you want to execute in this function.

argument ​

None

Return value ​
TypeDescription
booleanValidation result (true: normal, false: error)

validateDestroy ​

Perform validation before delete custom value. Describe the processing you want to execute in this function.

argument ​
NameTypeDescription
$custom_valueCustomValueInstance of custom data
Return value ​
TypeDescription
arrayValidation result and message (true: normal, false: error)
php
        [
            'status'  => false,
            'message' =>  'Data with high importance cannot be deleted.',
        ]

PluginViewBase ​

An abstract class for plugins (views). If you develop a view plugin, please inherit this class.
For more information here, please refer to.

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginPageTrait
Property ​
NameTypeDescription
custom_tableCustomTableCustom table instance
custom_viewCustomViewCustom view instance
useBoxboolWhether to display a button in the list
useBoxButtonsarrayWhich button to display
(newButton, menuButton, viewButton)

Function list ​

grid ​

This function is called as a list display process.

argument ​

None

Return value ​
TypeDescription
string,RenderableWhat to display on the grid

setViewOptionForm ​

Defines view-specific settings. For details, please refer to here.

argument ​
NameTypeDescription
&$form\ExmentAdminCore\Admin\Formform instance of the admin library (exment-admin-core; laravel-admin in v6.x or earlier)
Return value ​

None


PluginCrudBase ​

An abstract class for plugins (CRUD pages). When developing a CRUD page plugin, inherit this class.
For more information here, please refer to.
※ For the list of functions, please refer to the Plugin reference (CRUD page).

  • namespace Exceedone\Exment\Services\Plugin
  • trait Exceedone\Exment\Services\Plugin\PluginBase
  • trait Exceedone\Exment\Services\Plugin\PluginPageTrait
Property ​
NameTypeDescription
titlestringTitle displayed on each page of the plugin
descriptionstringDescription displayed on each page of the plugin
iconstringIcon displayed on each page of the plugin

Function list (must be implemented by the developer) ​

getFieldDefinitions ​

A function that returns the column definitions as an associative array. Describe the definitions of the items displayed on each page.

argument ​

None

Return value ​
TypeDescription
arrayReturns the definitions of the items on each page as an associative array
Return value - definition of the associative array ​
KeyDescription
keyItem name, used when retrieving data and as the name of each HTML element. Enter alphanumeric characters
labelText used as the item name on the list screen and other screens
gridSet for items displayed on the list screen. Enter an integer for the display order
showSet for items displayed on the details screen. Enter an integer for the display order
createSet for items displayed on the create screen. Enter an integer for the display order
editSet for items displayed on the edit screen. Enter an integer for the display order
Example ​
php
/**
     * Get fields definitions
     *
     * @return array|Collection
     */
    public function getFieldDefinitions()
    {
        return [
            ['key' => 'ID', 'label' => 'ID', 'primary' => true, 'grid' => 1, 'show' => 1, 'edit' => 1],
            ['key' => 'Name', 'label' => 'City name', 'grid' => 2,'show' => 2, 'create' => 1, 'edit' => 2],
            ['key' => 'CountryCode', 'label' => 'Country code', 'grid' => 3, 'show' => 3, 'create' => 2,'edit' => 3],
            ['key' => 'Population', 'label' => 'Population', 'show' => 5, 'create' => 4,'edit' => 5],
        ];
    }

getPaginate ​

A function that retrieves the data list in paginated form.
Return the retrieved data as a LengthAwarePaginator.
Each element of the list should be an associative array, and the keys of that associative array should be the same as the keys set in getFieldDefinitions.
※ When a search is performed on the screen, values are set in the argument $options. For details, please refer to the Plugin reference (CRUD page).

argument ​
NameTypeDescription
$optionsarrayOption values passed when the list screen is called
Return value ​
TypeDescription
LengthAwarePaginatorSearch result model