Skip to content
Plug and play packages for Laravel
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Laravel Plug and Play

Add to the Laravel application the ability to plug and play packages that are build with package discover without necessarily installing a new dependency on composer.json.

This package uses the great plugin Composer Merge Plugin which allows you to merge multiple composer.json files into the Composer runtime.


Laravel Plug and Play requires Composer 1.0.0 or newer.

composer require edersoares/laravel-plug-and-play

php artisan package:install


The composer.json file needs to be updated to something like:

    "require": {
        "edersoares/laravel-plug-and-play": "^1.0"
    "extra": {
        "merge-plugin": {
            "include": [

This package is a Composer Merge Plugin extension and its features can be used usually. See more in plugin configuration.

Adding a package

Move or clone the package to packages/<vendor>/<name> folder and runs:

composer update --lock 

Whenever package dependencies are updated, this command must be executed.

This will instruct Composer to recalculate the file hash for the top-level composer.json thus triggering composer-merge-plugin to look for the sub-level configuration files and update your dependencies.

Creating a package

To create a package execute:

php artisan package:create <vendor>/<name>

This will create a package in packages folder:

\_ <vendor>
  \_ <name>
    \_ src
      \_ ServiceProvider.php
    \_ composer.json

See the official documentation about package discover.

Removing a package

Just only remove the package folder and runs:

composer update --lock 


Laravel Plug and Play is licensed under the MIT license. See the license file for more details.

You can’t perform that action at this time.