Skip to content

Kirby 5.1.1

License

Represents the license of a plugin. Used to display the license in the Panel system view

Examples

use Kirby\Plugin\License;
use Kirby\Plugin\LicenseStatus;
use Kirby\Plugin\Plugin;

class MyCustomLicense extends License
{
  public function __construct(
    protected Plugin $plugin
  ){
    $this->name = 'My Custom License';
    $this->link = '<https://mylicenseshop.com>';
    $this->status = new LicenseStatus(
      value: 'missing',
      theme: 'negative',
      label: 'Get a license please',
      icon: 'alert',
      dialog: 'my/dialog/endpoint'
    )
  }
}

Kirby::plugin(
  name: 'my/plugin',
  extends: [...],
  license: fn (Plugin $plugin) => new MyCustomLicense($plugin)
);