PHPackages                             nystudio107/plugindev - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nystudio107/plugindev

ActiveProject[Utility &amp; Helpers](/categories/utility)

nystudio107/plugindev
=====================

nystudio107 Craft CMS plugin development environment scaffolding

1.2.4(2y ago)28273100BSDPHP

Since Feb 28Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/nystudio107/plugindev)[ Packagist](https://packagist.org/packages/nystudio107/plugindev)[ Docs](https://craftcms.com/)[ GitHub Sponsors](https://github.com/khalwat)[ RSS](/packages/nystudio107-plugindev/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (10)DependenciesVersions (74)Used By (0)

[![nystudio107](https://camo.githubusercontent.com/9be205c963a4fb70f43e3daa69ae864d2c12219df691414da63bea36a7f85e1c/68747470733a2f2f6e7973747564696f3130372e636f6d2f696d672f736974652f6e7973747564696f3130375f7375626d61726b2e737667)](https://craftcms.com/)

About nystudio107/plugindev
---------------------------

[](#about-nystudio107plugindev)

This is a project scaffolding package for Craft CMS 3, 4 &amp; 5 plugin development.

Read the [A Craft CMS Plugin Local Development Environment article](https://nystudio107.com/blog/a-craft-cms-plugin-local-development-environment) for full details on this project.

It gives you the following out of the box:

- Triple installs of both Craft CMS `^3.0.0`, Craft CMS `^4.0.0`, and Craft CMS `^5.0.0` running simultaneously
- `craftcms/redactor` plugin is installed
- `craftcms/commerce` plugin is installed
- A PHP 8.x environment with Imagick and other needed extensions pre-installed
- Code quality tools like `rector`, `phpstan`, and `ecs` are all baked in
- The Codeception PHP testing framework is installed and available for running tests
- A prefab database seed for both MySQL and Postgres databases
- The ability to switch between MySQL and Postgres easily
- A separate `test` database available for use during Codeception testing
- Dual [production/debug Docker](https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development#xdebug-performance) containers for PHP, for improved performance while also supporting XDebug
- Multiple sites for testing
- Prefab content with a "blog" channel for testing

Creating nystudio107/plugindev
------------------------------

[](#creating-nystudio107plugindev)

This project package works exactly the way Pixel &amp; Tonic's [craftcms/craft](https://github.com/craftcms/craft) package works; you create a new project via Composer:

```
composer create-project nystudio107/plugindev --no-install

```

This will create a project named `plugindev` which is a turnkey Craft CMS install for developing plugins.

We use `--no-install` so that the composer packages for the root project are not installed.

It works this way so that you can take the basic scaffolding, and then modify it as you see fit.

Getting Started with nystudio107/plugindev
------------------------------------------

[](#getting-started-with-nystudio107plugindev)

You'll need [Docker desktop](https://www.docker.com/products/docker-desktop) for your platform installed to run the project in local development

We also highly recommend that you use [OrbStack](https://orbstack.dev/) if you're running MacOS; it's a drop-in replacement for Docker Desktop that is significantly faster and more reliable.

- Craft CMS 3 runs out of the `cms_v3/` directory available at `http://plugindev.local:8003` with OrbStack (`http://localhost:8003` with Docker Desktop)
- Craft CMS 4 runs out of the `cms_v4/` directory available at `http://plugindev.local:8004` with OrbStack (`http://localhost:8004` with Docker Desktop)
- Craft CMS 5 runs out of the `cms_v5/` directory available at `http://plugindev.local:8005` with OrbStack (`http://localhost:8005` with Docker Desktop)

Each version of Craft CMS runs in separate Docker containers, and uses a separate database running out of the database containers (MySQL and Postgres).

Composer will have already created a `.env` file in the `cms_v3/`, `cms_v4` &amp; `cms_v5/` directories, based off of the respective `example.env` files.

### Setting up Local Dev

[](#setting-up-local-dev)

To set up your local dev environment, follow these steps:

- Edit the `cms_v3/composer.json` file and change the line `"url": "/Users/andrew/webdev/craft_v3/*",` in `repositories` to point to your local plugin Git repositories for Craft CMS 3
- Edit the `cms_v4/composer.json` file and change the line `"url": "/Users/andrew/webdev/craft_v4/*",` in `repositories` to point to your local plugin Git repositories for Craft CMS 4
- Edit the `cms_v5/composer.json` file and change the line `"url": "/Users/andrew/webdev/craft_v5/*",` in `repositories` to point to your local plugin Git repositories for Craft CMS 5
- Edit the `docker-composer.yaml` file and change the line `- /Users/andrew/webdev/craft_v3:/Users/andrew/webdev/craft_v3` to point to your local Craft CMS 3 plugin Git repositories
- Edit the `docker-composer.yaml` file and change the line `- /Users/andrew/webdev/craft_v4:/Users/andrew/webdev/craft_v4` to point to your local Craft CMS 4 plugin Git repositories
- Edit the `docker-composer.yaml` file and change the line `- /Users/andrew/webdev/craft_v5:/Users/andrew/webdev/craft_v5` to point to your local Craft CMS 4 plugin Git repositories

### Setting up Plugin Git Repos

[](#setting-up-plugin-git-repos)

To make working on plugins from multiple versions of Craft CMS easier, clone each of your plugin repositories down to the appropriate separate directories: `craft_v3`, `craft_v4`, and `craft_v5`.

These are two separate local repositories from the same remote git origin repository.

The path `repositories` in your respective `composer.json` files will cause Composer to install your plugins locally, rather than via Packagist, creating a symlink to the directories mentioned above.

This allows you to have all the repositories in the `craft_v3` directory set to your Craft CMS 3 compatible branch, all the repositories in the `craft_v4` directory set to your Craft CMS 4 compatible branch, and all the repositories in the `craft_v5` directory set to your Craft CMS 4 compatible branch.

This makes working with multiple versions of your plugins for multiple versions of Craft CMS much easier.

Each directory will always have their branches set appropriately, and you can have separate Git Flow settings via Git Tower or other clients for each.

Using nystudio107/plugindev
---------------------------

[](#using-nystudio107plugindev)

Start up the `plugindev` environment by typing `make dev` in a terminal window (the first build will be somewhat lengthy).

To stop the `plugindev` environment, type `Control-C` in the terminal window you used to start it, which terminates the Docker containers.

**N.B.:** Since the containers need to be built, and Composer needs to install all of the packages, the initial `make dev` can take some time. So before you attempt to load it in your web browser, wait until you see:

```
plugindev-php_v3-1         | [09-Mar-2022 04:05:33] NOTICE: fpm is running, pid 8
plugindev-php_v3-1         | [09-Mar-2022 04:05:33] NOTICE: ready to handle connections

```

...and:

```
plugindev-php_v4-1         | [09-Mar-2022 04:05:33] NOTICE: fpm is running, pid 8
plugindev-php_v4-1         | [09-Mar-2022 04:05:33] NOTICE: ready to handle connections

```

...and:

```
plugindev-php_v5-1         | [09-Mar-2022 04:05:33] NOTICE: fpm is running, pid 8
plugindev-php_v5-1         | [09-Mar-2022 04:05:33] NOTICE: ready to handle connections

```

### Login

[](#login)

- Navigate to `http://plugindev.local:8003` to use the Craft CMS 3 site
- Navigate to `http://plugindev.local:8004` to use the Craft CMS 4 site
- Navigate to `http://plugindev.local:8004` to use the Craft CMS 5 site

The default login for all `plugindev` sites is:

**User:** `admin`
**Password:** `password`

### Editor

[](#editor)

You should open the `craft_v3`, `craft_v4`, and `craft_v5` subdirectories in separate windows in your code editor of choice, rather than opening up the entire `plugindev` project in a single window.

This allows your editor to index each Craft CMS install separately for things like code completion, and it also allows you to have separate PHP language level inspection settings (PHP 7.1 for Craft CMS 3, PHP 8 for Craft CMS 4, PHP 8.2 for Craft CMS 5).

You can also set up IDEs like PhpStorm to use the PHP interpreter inside the appropriate Docker container (`plugindev_php_xdebug_v3` for Craft CMS 3, `plugindev_php_xdebug_v4` for Craft CMS 4, and `plugindev_php_xdebug_v5` for Craft CMS 5), and set up path mappings for XDebug.

Remember to enable the Symfony plugin if you're using PhpStorm for each project.

### Exposed ports &amp; services

[](#exposed-ports--services)

`plugindev` intentionally uses non-standard ports so you can run it side-by-side with another local dev environment, without risk of port conflicts.

The following ports are exposed on `localhost` while `plugindev` is running (these need to not be in use prior to starting up `plugindev`):

- `8003` - The Craft CMS 3 website
- `8004` - The Craft CMS 4 website
- `8005` - The Craft CMS 5 website
- `54320` - The Postgres database server
- `33060` - The MySQL database server

The following databases are available in both the MySQL and Postgres database containers:

- `project_v3` - the database for Craft CMS 3. User: `project` Password: `project`
- `project_v4` - the database for Craft CMS 4. User: `project` Password: `project`
- `project_v5` - the database for Craft CMS 5. User: `project` Password: `project`
- `test` - an entirely empty database that can be used for testing. User: `project` Password: `project`

Internally, there are also containers that run the Craft CMS queue automatically, and a Redis container for caching.

`make` Commands
---------------

[](#make-commands)

This project uses Docker to shrink-wrap the devops it needs to run around the project.

To make using it easier, we're using a Makefile and the built-in `make` utility to create a CLI API both for the project as a whole, and for the individual Craft CMS 3 &amp; Craft CMS 4 site.

You can read more about it in the [Using Make &amp; Makefiles to Automate your Frontend Workflow](https://nystudio107.com/blog/using-make-makefiles-to-automate-your-frontend-workflow) article.

### `make` Project Commands

[](#make-project-commands)

You can run the following from terminal in the root project directory:

- `make dev` - starts up the local dev server listening on `http://plugindev.local:8003/`, `http://plugindev.local:8004/` &amp; `http://plugindev.local:8005/`
- `make clean` - removes the `composer.lock` and the entire `vendor/` directory from the `cms_v3`, `cms_v4` &amp; `cms_v5` projects
- `make nuke` - restarts the project from scratch by running `make clean` (above), then shuts down the Docker containers, removes any mounted volumes (including the database), and then rebuilds the containers from scratch

### `make` CMS Commands

[](#make-cms-commands)

composer craft ecs mysql phpstan postgres rector ssh

You can run the following from terminal in the `cms_v3` or `cms_v4` CMS directories:

- `make composer xxx` - runs the `composer` command passed in, e.g. `make composer install` in the php container
- `make craft xxx` - runs the `craft` [console command](https://craftcms.com/docs/3.x/console-commands.html) passed in, e.g.: `make craft project-config/apply` in the php container
- `make codecept xxx` - runs the [Codeception](https://codeception.com/) testing framework with the passed in commands, e.g.: `make codecept run -c ./vendor/putyourlightson/craft-blitz` in the php container
- `make ecs xxx` - runs [Easy Coding Standard](https://github.com/symplify/easy-coding-standard) using the [Craft CMS ECS config](https://github.com/craftcms/ecs), with the passed in path, e.g.: `make ecs check vendor/nystudio107/craft-seomatic/src`. To automatically fix, add the `--fix` flag, e.g.: `make -- ecs check vendor/nystudio107/craft-seomatic/src --fix`. Additional settings are available in the `ecs.php` file
- `make mysql` - switches the project to use the MySQL database container; just reload the browser
- `make phpstan xxx` - runs [PHPStan](https://github.com/phpstan/phpstan) using the [Craft CMS PHPStan config](https://github.com/craftcms/phpstan), with the passed in path, e.g.: `make phpstan analyze vendor/nystudio107/craft-seomatic/src` or `make -- phpstan analyze -c vendor/nystudio107/craft-seomatic/phpstan.neon`. Additional settings are available in the `phpstan.neon` file
- `make postgres` - switches the project to use the Postgres database container; just reload the browser
- `make rector xxx` - runs [Rector](https://github.com/rectorphp/rector) using the [Craft CMS Rector config](https://github.com/craftcms/rector), with the passed in path, e.g.: `make rector process vendor/nystudio107/craft-seomatic/src`. Additional settings are available in the `rector.php` file
- `make ssh` - opens up a Unix shell inside the PHP container for the project

**Tip:** If you try a command like `make craft project-config/apply --force` you’ll see an error, because the shell thinks the `--force` flag should be applied to the `make` command. To side-step this, use the `--` (double-dash) to disable further option processing, like this: `make -- craft project-config/apply --force`

### Switching between MySQL &amp; Postgres

[](#switching-between-mysql--postgres)

The `plugindev` environment supports both MySQL and Postgres out of the box. It spins up a container for each database, and seeds them with a starter db.

To use MySQL (the default) just type:

```
make mysql
```

To use Postgres just type:

```
make postgres
```

...and then just reload the page.

This is great for ensuring your db queries work properly on both MySQL and Postgres, without having to set up two separate environments.

OrbStack support
----------------

[](#orbstack-support)

IF you use [OrbStack](https://orbstack.dev/) as a faster, more efficient replacement for Docker Desktop on the Mac, you can take advantage of some local domain aliases:

- `plugindev.local:8003`, `plugindev.local:8004` &amp; `plugindev.local:8005` - domain aliases for the respective web hosts
- `mysql.plugindev.local` - local domain alias for the MySQL database container
- `postgres.plugindev.local` - local domain alias for the Postgres database container

Dual PHP Containers for Xdebug
------------------------------

[](#dual-php-containers-for-xdebug)

By default, all of your requests will be routed through the production PHP container, for speedy local development and testing.

However, there is a second Xdebug PHP container that's always running too, for the time that you need to use Xdebug on the really tough problems.

What happens is a request comes in, Nginx looks to see if there's an `XDEBUG_SESSION` cookie set. If there's no cookie, it routes the request to the regular php container.

If however the `XDEBUG_SESSION` cookie is set (with any value), it routes the request to the php\_xdebug container.

You can set this cookie with a [browser extension, your IDE](https://xdebug.org/docs/step_debug), or via a number of other methods. Here is the Xdebug Helper browser extension for your favorite browsers: [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) - [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/xdebug-helper-for-firefox/) - [Safari](https://apps.apple.com/app/safari-xdebug-toggle/id1437227804?mt=12)

You can read more about it in the [An Annotated Docker Config for Frontend Web Development](https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development#xdebug-performance) article.

XDebug with VScode
------------------

[](#xdebug-with-vscode)

To use Xdebug with VSCode install the [PHP Debug extension](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) and use the following configuration in your `.vscode/launch.json`:

```
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true,
            "externalConsole": false,
            "pathMappings": {
                "/var/www/project/cms": "${workspaceRoot}/cms"
            },
            "ignore": ["**/vendor/**/*.php"]
        }
    ]
}
```

Below is the entire intact, unmodified `README.md` from Pixel &amp; Tonic's [craftcms/craft](https://github.com/craftcms/craft):

.....

[![Craft CMS](https://camo.githubusercontent.com/47095b3a61ba99a6473dd41068f7b92042ac6dad4e7a7e9563d7667b31653b9a/68747470733a2f2f6372616674636d732e636f6d2f6372616674636d732e737667)](https://craftcms.com/)

About Craft CMS
---------------

[](#about-craft-cms)

Craft is a flexible and scalable CMS for creating bespoke digital experiences on the web and beyond.

It features:

- An intuitive Control Panel for administration tasks and content creation.
- A clean-slate approach to content modeling and [front-end development](https://docs.craftcms.com/v3/dev/).
- A built-in Plugin Store with hundreds of free and commercial [plugins](https://plugins.craftcms.com/).
- A robust framework for [module and plugin development](https://docs.craftcms.com/v3/extend/).

Learn more about it at [craftcms.com](https://craftcms.com).

Tech Specs
----------

[](#tech-specs)

Craft is written in PHP (7+), and built on the [Yii 2 framework](https://www.yiiframework.com/). It can connect to MySQL (5.5+) and PostgreSQL (9.5+) for content storage.

Installation
------------

[](#installation)

See the following documentation pages for help installing Craft 3:

- [Server Requirements](https://docs.craftcms.com/v3/requirements.html)
- [Installation Instructions](https://docs.craftcms.com/v3/installation.html)
- [Upgrading from Craft 2](https://docs.craftcms.com/v3/upgrade.html)

Popular Resources
-----------------

[](#popular-resources)

- **[Documentation](http://docs.craftcms.com/v3/)** – Read the official docs.
- **[Guides](https://craftcms.com/guides)** – Follow along with the official guides.
- **[\#craftcms](https://twitter.com/hashtag/craftcms)** – See the latest tweets about Craft.
- **[Discord](https://craftcms.com/discord)** – Meet the community.
- **[Stack Exchange](http://craftcms.stackexchange.com/)** – Get help and help others.
- **[CraftQuest](https://craftquest.io/)** – Watch unlimited video lessons and courses.
- **[Craft Link List](http://craftlinklist.com/)** – Stay in-the-know.
- **[nystudio107 Blog](https://nystudio107.com/blog)** – Learn Craft and modern web development.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance50

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 95.1% 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 ~17 days

Recently: every ~43 days

Total

72

Last Release

734d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7570798?v=4)[Andrew Welch](/maintainers/khalwat)[@khalwat](https://github.com/khalwat)

---

Top Contributors

[![khalwat](https://avatars.githubusercontent.com/u/7570798?v=4)](https://github.com/khalwat "khalwat (387 commits)")[![bencroker](https://avatars.githubusercontent.com/u/57572400?v=4)](https://github.com/bencroker "bencroker (17 commits)")[![rostockahoi](https://avatars.githubusercontent.com/u/16897125?v=4)](https://github.com/rostockahoi "rostockahoi (2 commits)")[![michtio](https://avatars.githubusercontent.com/u/5818021?v=4)](https://github.com/michtio "michtio (1 commits)")

---

Tags

plugindevelopmentcmsCraftcraftcms

### Embed Badge

![Health badge](/badges/nystudio107-plugindev/health.svg)

```
[![Health](https://phpackages.com/badges/nystudio107-plugindev/health.svg)](https://phpackages.com/packages/nystudio107-plugindev)
```

###  Alternatives

[pennebaker/craft-architect

CraftCMS plugin to generate content models from JSON/YAML data.

72148.8k5](/packages/pennebaker-craft-architect)[supercool/buttonbox

A collection of utility field types.

8953.3k1](/packages/supercool-buttonbox)[weareferal/matrix-field-preview

Add screenshot previews to matrix and neo fields, helping you publish content quicker.

1717.9k](/packages/weareferal-matrix-field-preview)[topshelfcraft/walk

A Craft-aware array\_walk() method, plus some super-convenient console commands, to easily call Craft service methods on a collection of elements or values.

221.5k](/packages/topshelfcraft-walk)

PHPackages © 2026

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