ページ · Laravilt
Plugin Classes
The PluginProvider base class and the Plugin contract.
PluginProvider
Extend Laravilt\Plugins\PluginProvider. It already implements Laravilt\Plugins\Contracts\Plugin.
php
register() is abstract and required. boot() is optional.
Properties
| Property | Required | Default |
|---|---|---|
protected static string $id | Yes | none, must be unique |
protected static string $name | No | '' |
protected static string $version | No | '1.0.0' |
protected static string $description | No | '' |
protected static string $author | No | '' |
protected bool $enabled | No | true |
Methods
| Method | Returns | Description |
|---|---|---|
make() | static | Create an instance |
getId() | string | Plugin ID |
getName() | string | Display name |
getVersion() | string | Version |
getDescription() | string | Description |
getAuthor() | string | Author |
isEnabled() | bool | Whether the plugin is enabled |
enable() / disable() | static | Toggle the plugin |
register(Panel $panel) | void | Register components on the panel |
boot(Panel $panel) | void | Panel-specific boot logic |
The Plugin contract
Laravilt\Plugins\Contracts\Plugin requires getId(), register(Panel), boot(Panel), isEnabled() and static make(). Panel::plugin() and Panel::plugins() accept any object that implements it.