# Plugin information definition

# foreword

Since this file is in JSON format, you must write it according to the JSON specification. Wrong package.jsonwill cause the plugin to fail to run and the plugin list of the skin site to fail to load . After writing this file, you can go to BeJSON (opens new window) for JSON validation.

# field overview

# detailed introduction

# name

This is the unique identifier of the plugin. It is recommended to use kebab-case naming conventions, such as: my-plugin, this-is-an-example.

Remember, different namevalues represent different plugins, so you must not write version information here. Blessing Skin Server will think it's two plugins!

# version

This indicates the version of the plugin. The value type of this field must be a string .

Blessing Skin Server does not limit the content of this field, but we recommend that its value be a number, such as 1.0, 3.2.1, and the letter "v" is not recommended. Of course, if you use words like "Jessie" as your version, that's fine too.

The advantage of using the number as the version is that it is beneficial for the plug-in market to compare versions and prompt users to update and upgrade the plug-in.

# title

This is the name that the plug-in displays on the Plug-in Management page, and can use any characters supported by the UTF-8 character set. Duplicating the value of this field with other plugins does not affect their operation, but it will cause trouble for users.

# description

This is a description of the plugin, it should be of moderate length.

# author

The author of the plugin.

# namespace

The namespace of the plugin is defined here and cannot be repeated. All classes in the plugin srcdirectory will be loaded into this namespace. This namespace must also be added when calling the views defined in the plugin.

Because of the backslash notation used by JSON and namespaces in PHP, be careful to use the escape \\to represent \ in this field. Such as: Foo\\Barmeans Foo\Bar in PHP.

# config

This defines which view file the "Plugin Configuration" page is. If your plugin does not have or does not need a "Plugin Configuration" page, this field can be omitted. If your plugin configuration page is located at views/config.blade.php, you can also omit this field and Blessing Skin will recognize it automatically.

# url

This indicates the URL of the plug-in, which can be the introduction page or the address of the open source warehouse. The value of this field does not affect the operation of the plug-in, and it can also be omitted.

# require

This field is used to declare the dependencies of the plug-in. For more information, please move to declare dependencies

# enchants

The enchantsfield defines information that affects the plugin's behavior. This field is also subdivided into different fields.

# providers

The type of this field is an array of strings. Use the field to define the service provider to load (opens new window) .

When specifying the service provider to load, the namespace can be omitted, because all service providers must be loaded from the namespace specified by the plugin. Also, ServiceProvider after the class name can be omitted.

E.g:

{
  "namespace": "Example",
  "enchants": {
    "providers": [
      "Example\\MyServiceProvider",
      "Our"
    ]
  }
}

The above example defines two service providers. The first one is in full form; for the second one, Blessing Skin will automatically complete Example\\OurServiceProvider according to the ``namespace.

For more information, please read the service provider section of this document.

# conflicts

The structure of this field is similar to defining plugin dependencies. For specific functions, please read Declaring Plugin Conflicts .

# config

Use this field to specify the configuration page. Different from the root configfield, the root configfield specifies a view located in the plug-in, and the configfield specifies the class name of a class in the plug-in.

After declaring this field, when the user clicks "Configuration" on the "Plugin Page", the public rendermethod in the class pointed to by this field will be executed. You can think of this class as a controller, and the rendermethod is equivalent to the controller method, so you can perform arbitrary logic processing in the render method, and finally return a view or other content.

This configfield will take precedence over the root configfield.

# icon

Use this field to specify the plugin's icon in the Plugin Management page. Currently the value of this field is an object, which contains two attributes: one is the faattribute, which is used to specify which Font Awesome icon to display (no need to add the fa-prefix); the other is the bgattribute, which is used to specify the background of the icon Color (temporarily must be specified as those color names supported by AdminLTE v3).

Effect: