An example repository for creating php symfony flex bundles
@todo!
To execute the following command you will need Composer or a dockerized installation which already has php and composer.
U can install this plugin by installing with command:
composer require common-gateway/zgw-zds-bundle:dev-main or dockerized: docker-compose exec php composer require common-gateway/zgw-zds-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/zgw-zds-bundle or dockerized: docker-compose exec php bin/console commongateway:install common-gateway/zgw-zds-bundle
To create your own symfony bundle. You can copy this repository for a fast start.
Create repository from templateIf 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.
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:
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.
Before we can use our bundle and code, we must have it online on packagist so we can install with composer.
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.SubmitShow API Token and copyAdd webhookJust push the eventAdd webhookTo 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
composer require {full package name}:dev-mainuse CommonGateway\ZgwZdsBundle\Service\ZgwZdsService;)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 ZgwZdsService I can set the ZgwZdsHandler as CommonGateway\ZgwZdsBundle\ActionHandler\ZgwZdsHandler.
How can I help you explore Laravel packages today?