PHPackages                             apility/plugins - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. apility/plugins

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

apility/plugins
===============

Laravel plugin architecture

v0.0.2(3y ago)015MITPHP

Since Jan 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/apility/plugins)[ Packagist](https://packagist.org/packages/apility/plugins)[ RSS](/packages/apility-plugins/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

Laravel plugin architecture
===========================

[](#laravel-plugin-architecture)

This package provides a simple way of making your Laravel application modular. It implments a simple plugin architecture that allows you to create plugins and register them in a shared repository.

You can then use feature detection through interfaces or traits to registered plugins.

The plugins are an abstraction around Laravel's service providers, so you can use all the features of service providers in your plugins.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require apility/plugins
```

Usage
-----

[](#usage)

### Creating a plugin

[](#creating-a-plugin)

To create a plugin, you need to create a class that implements the `Apility\Plugins\Contracts\Plugin` interface.

The simplest way to do this is to extend from the abstract `Apility\Plugins\Plugin` class.

```
use Apility\Plugins\Plugin;

class MyPlugin extends Plugin
{
    public function register()
    {
        // Here you can perform any registration that
        // you would normally do in a service provider.
    }
}
```

### Registering a plugin

[](#registering-a-plugin)

To register a plugin, you need to register them in the plugin repository.

The plugin repository is a singleton that implements the `Apility\Plugins\Contracts\PluginRepository` interface.

The recommended way to interface with the repository is through the `Apility\Plugins\Facades\Plugin` facade.

```
use Apility\Plugins\Facades\Plugin;

Plugin::register(MyPlugin::class);
```

### Using a plugin

[](#using-a-plugin)

The main purpose of this package is to allow you to use plugins in your application through feature detection.

You can use the `Apility\Plugins\Facades\Plugin` facade to resolve plugins based on features (interfaces or traits).

```
use Apility\Plugins\Facades\Plugin;
use Apility\Plugins\Plugin as BasePlugin;

interface MyFeature
{
    public function doSomething();
}

class MyPlugin extends BasePlugin implements MyFeature
{
    public function doSomething()
    {
        return 'Hello world!';
    }
}

$plugins = Plugin::all(MyFeature::class);

foreach ($plugins as $plugin) {
    /** @var MyFeature $plugin */
    echo $plugin->doSomething();
}
```

#### Other ways of using plugins

[](#other-ways-of-using-plugins)

```
use Apility\Plugins\Facades\Plugin;

// Get the number of registered plugins
$pluginCount = Plugin::count();

// Get the number of registered plugins by type
$pluginCount = Plugin::count(MyPlugin::class);

// Check if a plugin is registered
$pluginRegistered = Plugin::has(MyPlugin::class);

// Get all plugins
$plugins = Plugin::all();

// Get all plugins by type
$plugins = Plugin::all(MyPlugin::class);

// Get the first registered plugin
$plugin = Plugin::first();

// Get a plugin by type
$plugin = Plugin::first(MyPlugin::class);
```

Generating a plugin
-------------------

[](#generating-a-plugin)

You can use the `make:plugin` command to generate a plugin.

```
php artisan make:plugin MyPlugin
```

### Generating a plugin with Policy

[](#generating-a-plugin-with-policy)

You can use the `--policy` option to generate a plugin with a corresponsing policy.

```
php artisan make:plugin MyPlugin --policy
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1260d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14291825?v=4)[Thomas Alrek](/maintainers/thomas-alrek)[@thomas-alrek](https://github.com/thomas-alrek)

---

Top Contributors

[![thomas-alrek](https://avatars.githubusercontent.com/u/14291825?v=4)](https://github.com/thomas-alrek "thomas-alrek (4 commits)")

---

Tags

pluginlaravel

### Embed Badge

![Health badge](/badges/apility-plugins/health.svg)

```
[![Health](https://phpackages.com/badges/apility-plugins/health.svg)](https://phpackages.com/packages/apility-plugins)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[livewire/flux

The official UI component library for Livewire.

9527.8M127](/packages/livewire-flux)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
