Download the PHP package aliirfaan/citronel-external-service-generator without Composer
On this page you can find all versions of the php package aliirfaan/citronel-external-service-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aliirfaan/citronel-external-service-generator
More information about aliirfaan/citronel-external-service-generator
Files in aliirfaan/citronel-external-service-generator
Package citronel-external-service-generator
Short Description Generate configuration and classes to consume an external service. Use in conjuction with aliirfaan/citronel-external-service
License MIT
Informations about the package citronel-external-service-generator
Citronel external service generator
Generate configuration and classes to consume an external service that use the package aliirfaan/citronel-external-service
.
Features
- Generate a configuration file based on a format.
- Generate service class to consume external service.
- Custom stub to generate service class, models, events and listeners.
- Helper function for caching responses.
Requirements
Installation
- Install the package using composer as a dev requirement:
Usage
An example of how to consume an example external service httpbin.
Generate configuration
To generate configuration file we call the command citronel:external-service-generate:config {external_service_name}
. Replace {external_service_name} with a sensible name for your external service.
Migration and models
Generating external service request migration and model
-
Generate migration using custom stub. Name your model accordingly before running the command.
-
Add your custom columns to the newly generated migration based on data you want to log.
- Update your config file with the newly model class.
Generating external service response migration and model
-
Generate migration using custom stub. Name your model accordingly before running the command.
-
Add your custom columns to the newly generated migration based on data you want to log.
- Update your config file with the newly model class.
Run your newly generated migration to create tables
You can run migration later if you do not know what fields to log.
Request/response events
Generating external service request event
-
Generate request event using custom stub. Name your event accordingly before running the command.
- Update your config file with the newly created event class.
Generating external service response event
-
Generate response event using custom stub. Name your event accordingly before running the command.
- Update your config file with the newly created event class.
Listener
Generating event subscriber
-
Generate subscriber using custom stub. Name your listener accordingly before running the command.
- Register event subscriber
Service
Generating service clas
- Generate service using custom stub. Name your service accordingly before running the command.
aliirfaan/citronel-external-service
-
Install the package aliirfaan/citronel-external-service if you have not already done so:
- See documentation of
aliirfaan/citronel-external-service
package on how to use newly generated classes.
All versions of citronel-external-service-generator with dependencies
laravel/framework Version >=11.0
aliirfaan/citronel-external-service Version ^1.0