Skip to content

Extending Fresns

The Fresns extension is based on the Plugin Manager package and extends and enriches the main Fresns application with modular plugins.

Directory Structure

php
fresns/             // Main program root directory
└── plugins/            // Plugins directory
    └── DemoPlugin/         // Example plugin
        ├── app/
        ├── config/
        ├── database/
        ├── resources/
   ├── assets/
   ├── fresns.png  // Plugin cover image (square), must be present and fixed in position
   ├── js/
   └── app.js
   └── sass/
       └── app.scss
   ├── lang/
   └── views/
        ├── routes/
        ├── tests/
        ├── plugin.json
        └── composer.json

File Publish

When the plugin is installed and published, static resources are distributed to the public directory.

Plugin FolderPublish to the site resource directory
/plugins/{fskey}/Resources/assets//public/assets/{fskey}/
Other FileNo Publish

plugin.json Config File

json
{
    "fskey": "DemoPlugin", // The only key, upper camel case
    "name": "Demo Plugin",
    "description": "This is the demo plugin",
    "author": "Jevan Tang",
    "authorLink": "https://github.com/jevantang",
    "version": "1.0.0",
    "panelUsages": [
        // Plugin usage scenarios
    ],
    "accessPath": "/mall", // Front-end visitor page path
    "settingsPath": "/mall/admin", // Back-end settings page path
    "providers": [
        "Plugins\\FresnsEmail\\Providers\\FresnsEmailServiceProvider",
        "Plugins\\FresnsEmail\\Providers\\CmdWordServiceProvider",
        "Plugins\\FresnsEmail\\Providers\\EventServiceProvider"
    ],
    "autoloadFiles": [
        // autoload files
    ],
    "aliases": {}
}
  • Plugin usage scenario panelUsages parameters
Usage KeyDescriptionControl Panel Location
storageStorage Service ProviderPanel->Systems->Storage
joinConfiguration of the "private mode" registration functionPanel->Systems->General
sendEmailEmail Service ProviderPanel->Systems->Send
sendSmsSMS Service ProviderPanel->Systems->Send
appNotificationsMobile Notification Service ProviderPanel->Systems->Send
wechatNotificationsWeChat Notification Service ProviderPanel->Systems->Send
accountCenterAccount Center SupportPanel->Systems->Account
accountRegisterAccount Register SupportPanel->Systems->Account
accountLoginAccount Register SupportPanel->Systems->Account
accountConnectAccount Connect SupportPanel->Systems->Account
accountKycReal Name Authentication SupportPanel->Systems->Account
walletRechargeWallet Recharge Service ProviderPanel->Systems->Wallet
walletWithdrawWallet Withdrawal Service ProviderPanel->Systems->Wallet
editorEditor PluginPanel->Operations->Publish
followGroupGroup Follow Mode SupportPanel->Operations->Groups
extendIpIP Service ProvidersPanel->Extends->Content Handler
extendMapMap Service ProvidersPanel->Extends->Content Handler
extendNotificationNotification ProviderPanel->Extends->Content Handler
extendReviewReview Service ProviderPanel->Extends->Content Handler
extendDataData Service ProviderPanel->Extends->Content Handler
extendSearchSearch Service ProvidersPanel->Extends->Content Handler
extendContentTypeContent Type ExtensionsPanel->Extends->Content Type
extendEditorEditor ExtensionsPanel->Extends->Editor
extendManageManagement ExtensionsPanel->Extends->Manage
extendGroupGroup ExtensionsPanel->Extends->Group
extendUserUser Function ExtensionsPanel->Extends->User Feature
Panel->Extends->User Profile
extendChannelChannel ExtensionsPanel->Extends->Channel
apiKeyPlugin requires key servicePanel->App Center->App Keys

composer.json Config File

json
{
    "name": "fresns/fresns-email",
    "license": "Apache-2.0",
    "require": {
        "laravel/email": "^2.0"
    },
    "autoload": {
        "psr-4": {
            "Plugins\\FresnsEmail\\": "./"
        }
    }
}

Released under the Apache-2.0 License