Skip to content
Radicle
v1.4.1

Service Provider Configuration

Radicle uses service providers for configuring and bootstraping various services.

Unfamiliar with service providers? We suggest reading the Laravel documentation on service providers

Radicle comes with the following service providers out of the box:

  • AssetsServiceProvider — Used for WordPress assets (CSS and JS) registration
  • BlockServiceProvider — Used for block related filters
  • PostTypesServiceProvider — Used for post type and taxonomy registration from a config
  • ThemeServiceProvider — Used for registering theme supports and sidebars from a config

These service providers are loaded from the composer.json file:

...
    "extra": {
        "acorn": {
            "providers": [
                "App\\Providers\\AssetsServiceProvider",
                "App\\Providers\\BlocksServiceProvider",
                "App\\Providers\\ThemeServiceProvider",
                "App\\Providers\\PostTypesServiceProvider"
            ]
        },
...

You can add/modify/remove these service providers. If adding or removing providers, we recommend changing the composer.json file.

Acorn's CLI supports creating a new service provider class:

$ wp acorn make:provider ExampleProvider

After creating a new provider class, make sure to add it to the providers array in composer.json.

It is also possible to use the config/app.php file and modify the providers array to manage autoloaded service providers.

Last updated

Support Roots

Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.

Sponsor Roots on GitHub