PHPackages                             common-gateway/bag-bundle - 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. [Framework](/categories/framework)
4. /
5. common-gateway/bag-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

common-gateway/bag-bundle
=========================

An example package for creating symfony flex bundles as plugins

0.0.4(3y ago)00[2 PRs](https://github.com/CommonGateway/BAGBundle/pulls)EUPL-1.2PHPPHP &gt;=7.4

Since Dec 12Pushed 3y ago3 watchersCompare

[ Source](https://github.com/CommonGateway/BAGBundle)[ Packagist](https://packagist.org/packages/common-gateway/bag-bundle)[ Docs](https://commongateway.nl)[ RSS](/packages/common-gateway-bag-bundle/feed)WikiDiscussions main Synced 1mo ago

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

BAGBundle
=========

[](#bagbundle)

An example repository for creating php symfony flex bundles

### Using this bundle

[](#using-this-bundle)

#### Installing with common-gateway admin user-interface

[](#installing-with-common-gateway-admin-user-interface)

@todo!

#### Installing with php commands

[](#installing-with-php-commands)

To execute the following command you will need [Composer](https://getcomposer.org/download/) or a dockerized installation which already has php and composer.

U can install this plugin by installing with command: `composer require common-gateway/bag-bundle:dev-main` or dockerized: `docker-compose exec php composer require common-gateway/bag-bundle:dev-main`in the directory where your composer.json lives.

If you also want to install the schemas as entities you can install them with command: `php bin/console commongateway:install common-gateway/bag-bundle` or dockerized: `docker-compose exec php bin/console commongateway:install common-gateway/bag-bundle`

### Creating your own bundle

[](#creating-your-own-bundle)

##### Requirements

[](#requirements)

- [GitHub](https://github.com/login) account or organization
- [Packagist](https://packagist.org/login/) account
- [Composer](https://getcomposer.org/download/) or if your project is dockerized, [Docker Desktop](https://www.docker.com/products/docker-desktop/)

#### Using this template

[](#using-this-template)

To create your own symfony bundle. You can copy this repository for a fast start.

1. Login on [GitHub](https://github.com)
2. Use [this template](https://github.com/CommonGateway/BAGBundle/generate)
3. Name your bundle (CamelCase)
4. Press the green button `Create repository from template`
5. Update file names and namespace to your fitting
    - Open composer.json, and change the name to your fitting. The first word should be the namespace and the second the name of your bundle. Check the autoload field to be set accordingly. Note: this is kebab-case. Also read: [naming your package](https://packagist.org/about#naming-your-package)
    - Open BAGBundle.php and change the Bundle name and namespace. The namespace should be the same as your package name in composer.json but in CamelCase. So common-gateway/bag-bundle becomes CommonGateway/BAGBundle
    - Rename the /Service and /ActionHandler accordingly (or delete if not used).
    - Rename the /DependencyInjection/BAGExtension.php to your BundleNameExtension.php
    - Rename the /Resources/config/services.yaml namespaces

##### Adding schemas

[](#adding-schemas)

If you use your bundel with the common-gateway, you can add your own schemas that will be loaded as Entities. These Entities will be loaded into the database so you can work with your own objects/data.

These schemas are [json schema's](https://json-schema.org/learn/getting-started-step-by-step.html#starting-the-schema).

You can add existing schemas or create your own and add them in /Schema. There is also an example as /Schema/example.json.

Make sure your schema's have a `version` property (required) so you can update your schema's! Also make sure they have a unique `$id` so that they can be related to other schema's.

All required properties are:

- 'version' can start on '0.1.0'
- '$schema' ()
- '$id' ()
- 'type' must be 'object'
- 'properties' muste be schema properties

If you don't have all required properties in your schema the gateway won't install that schema and will claim it is invalid.

If you have added schema's you can also add objects/data for them, in /Data is an example you can use.

#### Upload to packagist

[](#upload-to-packagist)

Before we can use our bundle and code, we must have it online on packagist so we can install with composer.

1. Upload to packagist
    - Go to [Packagist](https://packagist.org)
    - Press `submit` in the top menu bar and paste your bundle's github repository link, the name from you composer.json will be used as package name.
    - If valid press `Submit`
2. Auto-update package
    - Go to your [packagist profile](https://packagist.org/profile/).
    - Press `Show API Token` and copy
    - Go to your new bundle's github repository
    - Go to your repository settings
    - Go to webhooks, and press `Add webhook`
    - As Payload URL, set
    - Keep SSL verification enabled
    - As secret, paste the copied API token from packagist
    - Set event on `Just push the event`
    - Press `Add webhook`
    - If you push new code it will now push to packagis. On packagist you should not see the auto-update warning anymore. If its still there check if your username and secret are set properly on the github webhook.

#### Using your code

[](#using-your-code)

To use the code in your library we first have to install it with composer.

Note: for docker add `docker-compose exec php` before all commands

1. Navigate with a command line to where your composer.json lives in the project you want to use this bundle.
    - Execute `composer require {full package name}:dev-main`
    - Docker users: restart your containers so symfony can recognize the new Bundle's namespace
2. Open a php file where you want to use a class.
    - Add the correct use statement (example `use CommonGateway\BAGBundle\Service\BAGBundleService;`)
    - U can now use your class!

In the common gateway, if you want to use your code when triggered by an event with a action, make sure the class of the action object is set as the handler name including the namespace. For example if I want to use the BAGBundleService I can set the BAGBundleHandler as `CommonGateway\BAGBundle\ActionHandler\BAGBundleHandler`.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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 ~28 days

Total

4

Last Release

1159d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67946687e214c06f0b6293cbebbfab8bd1662dd52a66f5b85a83571c62563dfb?d=identicon)[rubenvdlinde](/maintainers/rubenvdlinde)

![](https://www.gravatar.com/avatar/8a7f1a91dc2ccd4cba1ee706c9691640e75220cdba7efc4b5ca9385290bfe9c1?d=identicon)[rjzondervan](/maintainers/rjzondervan)

![](https://www.gravatar.com/avatar/06daf7bcf34d1b8ca6b1864849870b08ccb110b6ec3163f976631cc6464d7e43?d=identicon)[Novab](/maintainers/Novab)

---

Top Contributors

[![NovaEBA](https://avatars.githubusercontent.com/u/63096721?v=4)](https://github.com/NovaEBA "NovaEBA (2 commits)")

---

Tags

symfonycommongatewayconductioncommongatewaycommon-gateway-pluginpet store

### Embed Badge

![Health badge](/badges/common-gateway-bag-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/common-gateway-bag-bundle/health.svg)](https://phpackages.com/packages/common-gateway-bag-bundle)
```

PHPackages © 2026

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