System\Classes\PluginBase

Source: ~/modules/system/classes/PluginBase.php

Extends:

  • Illuminate\Support\ServiceProvider

Plugin base class

Public properties

public array $require

Plugin dependencies

public boolean $elevated

Determine if this plugin should have elevated privileges.

public boolean $disabled

Determine if this plugin should be loaded (false) or not (true).

Show inherited public properties

Inherited public properties

  • public static array $publishes - defined in Illuminate\Support\ServiceProvider. The paths that should be published.
  • public static array $publishGroups - defined in Illuminate\Support\ServiceProvider. The paths that should be published by group.

Protected properties

protected boolean $loadedYamlConfiguration

Show inherited protected properties

Inherited protected properties

  • protected Illuminate\Contracts\Foundation\Application $app - defined in Illuminate\Support\ServiceProvider. The application instance.
  • protected bool $defer - defined in Illuminate\Support\ServiceProvider. Indicates if loading of the provider is deferred.

Public methods

public array boot()

Boot method, called right before the request route.

public array pluginDetails()

Returns information about this plugin, including plugin name and developer name.

public void register()

Register method, called when the plugin is first registered.

public array registerComponents()

Registers any front-end components implemented in this plugin.

public void registerConsoleCommand(string $key, string $class)

Registers a new console (artisan) command

Parameters
  • string $key - The command name
  • string $class - The command class

public array registerFormWidgets()

Registers any form widgets implemented in this plugin. The widgets must be returned in the following format:

return [
    ['className1' => 'alias'],
    ['className2' => 'anotherAlias']
];

public array registerListColumnTypes()

Registers custom back-end list column types introduced by this plugin.

public array registerMailLayouts()

Registers any mail layouts implemented by this plugin. The layouts must be returned in the following format:

return [
    'marketing'    => 'acme.blog::layouts.marketing',
    'notification' => 'acme.blog::layouts.notification',
];

public array registerMailPartials()

Registers any mail partials implemented by this plugin. The partials must be returned in the following format:

return [
    'tracking'  => 'acme.blog::partials.tracking',
    'promotion' => 'acme.blog::partials.promotion',
];

public array registerMailTemplates()

Registers any mail templates implemented by this plugin. The templates must be returned in the following format:

return [
    'acme.blog::mail.welcome',
    'acme.blog::mail.forgot_password',
];

public array registerMarkupTags()

Registers CMS markup tags introduced by this plugin.

public array registerNavigation()

Registers back-end navigation items for this plugin.

public array registerPermissions()

Registers any back-end permissions used by this plugin.

public array registerReportWidgets()

Registers any report widgets provided by this plugin. The widgets must be returned in the following format:

return [
    'className1'=>[
        'label'    => 'My widget 1',
        'context' => ['context-1', 'context-2'],
    ],
    'className2' => [
        'label'    => 'My widget 2',
        'context' => 'context-1'
    ]
];

public void registerSchedule(string $schedule)

Registers scheduled tasks that are executed on a regular basis.

Parameters
  • string $schedule

public array registerSettings()

Registers any back-end configuration links used by this plugin.

Show inherited public methods

Inherited public methods

  • public void __construct(Illuminate\Contracts\Foundation\Application $app) - defined in Illuminate\Support\ServiceProvider. Create a new service provider instance.
  • public void commands(array|mixed $commands) - defined in Illuminate\Support\ServiceProvider. Register the package's custom Artisan commands.
  • public bool isDeferred() - defined in Illuminate\Support\ServiceProvider. Determine if the provider is deferred.
  • public static array pathsToPublish(string $provider=NULL, string $group=NULL) - defined in Illuminate\Support\ServiceProvider. Get the paths to publish.
  • public array provides() - defined in Illuminate\Support\ServiceProvider. Get the services provided by the provider.
  • public static array publishableGroups() - defined in Illuminate\Support\ServiceProvider. Get the groups available for publishing.
  • public static array publishableProviders() - defined in Illuminate\Support\ServiceProvider. Get the service providers available for publishing.
  • public array when() - defined in Illuminate\Support\ServiceProvider. Get the events that trigger this service provider to register.

Protected methods

protected array|bool getConfigurationFromYaml(string|null $exceptionMessage=NULL)

Read configuration from YAML file

Parameters
  • string|null $exceptionMessage

Show inherited protected methods

Inherited protected methods

  • protected void addPublishGroup(string $group, array $paths) - defined in Illuminate\Support\ServiceProvider. Add a publish group / tag to the service provider.
  • protected void ensurePublishArrayInitialized(string $class) - defined in Illuminate\Support\ServiceProvider. Ensure the publish array for the service provider is initialized.
  • protected void loadJsonTranslationsFrom(string $path) - defined in Illuminate\Support\ServiceProvider. Register a JSON translation file path.
  • protected void loadMigrationsFrom(array|string $paths) - defined in Illuminate\Support\ServiceProvider. Register a database migration path.
  • protected void loadRoutesFrom(string $path) - defined in Illuminate\Support\ServiceProvider. Load the given routes file if routes are not already cached.
  • protected void loadTranslationsFrom(string $path, string $namespace) - defined in Illuminate\Support\ServiceProvider. Register a translation file namespace.
  • protected void loadViewsFrom(string|array $path, string $namespace) - defined in Illuminate\Support\ServiceProvider. Register a view file namespace.
  • protected void mergeConfigFrom(string $path, string $key) - defined in Illuminate\Support\ServiceProvider. Merge the given configuration with the existing configuration.
  • protected static array pathsForProviderAndGroup(string $provider, string $group) - defined in Illuminate\Support\ServiceProvider. Get the paths for the provider and group.
  • protected static array pathsForProviderOrGroup(string|null $provider, string|null $group) - defined in Illuminate\Support\ServiceProvider. Get the paths for the provider or group (or both).
  • protected void publishes(array $paths, string $group=NULL) - defined in Illuminate\Support\ServiceProvider. Register paths to be published by the publish command.