durdev/adrgen

ADR pattern directories and files generator

v0.0.2 2021-05-09 13:58 UTC

This package is auto-updated.

Last update: 2024-04-09 20:13:01 UTC


README

Starship – Cross-shell prompt

68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6475726465762f61647267656e2f504850253230436f6d706f7365723f7374796c653d666f722d7468652d6261646765

Installation | Usage | License

The simplest and best generator ADR classes and directories

Installation

Prerequisites

  • PHP 7.3 or newer
  • Composer

Getting Started

  1. Install as a global package
composer global require durdev/adrgen
  1. Make sure your global vendor binaries dir is in your $PATH
  • Append the composer bin path to your bashrc (or zshrc or any *rc file)
  echo 'PATH=$(composer global config bin-dir --absolute --quiet):$PATH' >> ~/.bashrc && source ~/.bashrc

Now that's all good to go.

Commands and usage

Command Description Options Arguments
adrgen make Generates the basic CRUD operations files --dir model

Details

  1. --dir: required your directory that will be the root folder for ADR actions directories
  2. model: required the model's name to be created

Example:

adrgen make user --dir=/var/www/project/actions

The default template created

/var/www/project/actions                # Actions dir
├── (D) User                            # Capitalized model
│   ├── (D) Index                       # Action dir
|   |   ├── (F) IndexUserAction.php     # Action file
|   |   └── (F) IndexUserResponder.php  # Responder file
│   ├── (D) Create
|   |   ├── (F) CreateUserAction.php
|   |   └── (F) CreateUserResponder.php
│   ├── (D) Store
|   |   ├── (F) StoreUserAction.php
|   |   └── (F) StoreUserResponder.php
│   ├── (D) Edit
|   |   ├── (F) EditUserAction.php
|   |   └── (F) EditUserResponder.php
│   ├── (D) Update
|   |   ├── (F) UpdateUserAction.php
|   |   └── (F) UpdateUserResponder.php
│   ├── (D) Delete
|   |   ├── (F) DeleteUserAction.php
└── └── └── (F) DeleteUserResponder.php

License

MIT