Plugin Development

A plugin lets you add an individual bit of additional functionality, or allows modifying data that is being handled by the system. Follow our development guide to build your own useful plugin.

Getting Started

Learn about what a plugin is, a plugin's basic structure and how to initially configure your own plugin.

Controllers

Controllers contain the logic of the plugin and is where most of your code will go. SupportPal is built on top of the Laravel framework, and thus most of the features available in the framework are also available to you to use in plugins, such as caching and the query builder.

Routes

Routes allow you to create additional pages in the system that can only be accessed when the plugin is active. All of your routes must be placed in one or several PHP files in the Routes folder. You can register a route for any HTTP verb, the most common Router methods are get(), post(), put() and delete().

Languages

Translate your plugin for several different languages with ease.

Views

Create your own templates for viewing pages in the plugin.

Registering Settings

SupportPal comes with a PluginSetting model that can be used to store any settings required for the plugin to operate.

Permissions

You may wish to restrict some actions or views in your plugin to certain operator roles only, and this can be achieved by using the permissions system.

Reports

Plugins can define their own reports, which will be visible on the report dashboard within the operator panel.

Form Requests

Form requests let you validate request data before handling it in the controller action.

Model Events

SupportPal was built with Eloquent ORM, an ActiveRecord implementation with the idea that each record, be it a ticket, user or even an activity log message is a model. Each model has a lifecycle, firing different events when the model is created, updated or deleted. Model events allow you to hook on to these events and use or update the model data as needed.

Extending Templates

Plugins give you the option to inject data in to and completely override existing templates.

Scheduled Tasks

If your plugin needs to perform a recurring task, you can set up a scheduled task to run on your chosen schedule for the plugin.

Sending Email

Use our mailer class to make sending email through your plugin simpler.

Upgrading

It is common you may wish to update the plugin at some point after the initial version and add new settings, permissions or modify the database. This can be done by making use of the simple plugin upgrade system that can run targeted code when the currently installed version is below the new plugin version.