PHPackages                             csgt/utils - 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. csgt/utils

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

csgt/utils
==========

CSGT Utils

v10.0.11(2w ago)02.7k21PHPPHP &gt;=7.2CI passing

Since Sep 4Pushed 2w ago3 watchersCompare

[ Source](https://github.com/csgt/utils)[ Packagist](https://packagist.org/packages/csgt/utils)[ RSS](/packages/csgt-utils/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (69)Used By (1)

csgt/utils
==========

[](#csgtutils)

[![Tests](https://github.com/csgt/utils/actions/workflows/tests.yml/badge.svg)](https://github.com/csgt/utils/actions/workflows/tests.yml)

Internal Softlogic package that scaffolds and standardizes CSGT Laravel projects. It publishes the CI/CD pipeline (`make:csgtci`), the Docker environment (`make:csgtdocker`), the standard documentation (`make:csgtdocs`) and the base app scaffolding (`make:csgtutils`), and ships the shared admin utilities used by every project (users/roles/profile controllers, menu rendering and misc helpers).

Versions
--------

[](#versions)

One branch per major version — every version is in active use by projects pinned to it, so fixes are applied to the branch of the affected version. Install the line that matches your project:

```
composer require csgt/utils:^10.0
```

Package VersionLaravel UICancerberoCrud versionMenu TableAdminLTEVuePHPWebserver5.0nonames?es?2?nginx6.0nonames?en?2?nginx5.7nonames?en?2?nginx7.0yesnames?en?2?nginx8.0yesnames7en3.2.0-beta2?nginx9.0yesnames8en4.0.0-alpha38.1octane10.0yesnames8en4.0.0-alpha38.2octaneMenu
----

[](#menu)

To render the menu, use the following snippet. This will auto-generate the required structure needed for the `csgt/menu` package.

```
{!! \Csgt\Utils\Menu::menu() !!}

```

CI/CD Pipeline
--------------

[](#cicd-pipeline)

Publish a GitHub Actions workflow that runs CI (code style, tests, frontend build) on every push and pull request, and deploys to production on the main branch only when CI passes.

```
php artisan make:csgtci
```

This creates `.github/workflows/ci.yml`. Everything is auto-detected so the bare command works without flags: the trigger/deploy branch is the repository's default branch (works for both `master` legacy and `main` newer projects), the PHP version is read from `composer.json` (`config.platform.php` or `require.php`), and the Node version from `.nvmrc` or `package.json` (`engines.node`). Pass flags only to override the detection:

```
php artisan make:csgtci --php=8.2 --node=18 --branch=master
```

OptionDefaultDescription`--php`auto-detected (`composer.json`)PHP version used by the CI job`--node`auto-detected (`.nvmrc`/`package.json`)Node version used by the CI job`--branch`auto-detectedBranch that triggers CI and deployment`--force`—Overwrite the workflow if it already existsThe `ci` job is universal and rarely needs editing. Projects without tests pass CI harmlessly: the test step skips when no `phpunit.xml` is present and becomes enforcing once tests exist.

The `deploy` job is project-specific (host, Docker, Octane, etc.). Configure the repository secrets:

SecretRequiredDescription`PRODUCTION_HOST`yesServer hostname or IP`PRODUCTION_USER`yesSSH user`PRODUCTION_PATH`yesAbsolute path of the project on the server`PRODUCTION_SSH_KEY`yesUnencrypted private deploy key (no passphrase)`PRODUCTION_SSH_PORT`noSSH port (defaults to 22)`PRODUCTION_SSH_KNOWN_HOSTS`noPinned host key; prevents MITM (falls back to keyscan)`PRODUCTION_HEALTHCHECK_URL`noURL checked after deploy; deploy fails if not HTTP 200CI runs are cancelled when superseded by a newer commit, but deployments are never cancelled mid-flight (concurrent pushes queue) to avoid leaving the server half-migrated.

After migrating, the deploy runs `db:seed --force` and then `db:seed --class=GodSeeder --force` (the latter only when `database/seeders/GodSeeder.php` exists). The ACL — modules, permissions and menu — is generated from the seeders, so without this step new permissions never reach production even though the migrations do. This is safe to repeat because CSGT seeders rebuild derived data (clear then insert, or `updateOrInsert`). **If a project adds a seeder with business data, guard it or keep it out of `DatabaseSeeder`**, otherwise it re-runs on every deploy.

Docker environment
------------------

[](#docker-environment)

Publish the local Docker environment (Ubuntu 24.04 + Octane/Swoole on port 81, MySQL and Redis):

```
php artisan make:csgtdocker
```

This creates the following files, with no options to configure:

- `docker-compose.yml` and `docker-compose.yml.example` — `app`, `mysql` and `redis` services. `app` publishes `127.0.0.1:80` (Octane) and `127.0.0.1:5173` (Vite), mounts the project at `/var/www`, and waits for MySQL to start and Redis to pass its healthcheck. MySQL data persists in the `mysql-data` volume.
- `dockerfiles/app/Dockerfile` — the app image (PHP with Swoole, Node, Composer). Build args: `NODE_VERSION` (defaults to 24) and `SUPERVISOR_OCTANE_EXTRA` (set to `--watch` in the compose file so Octane reloads on file changes).
- `dockerfiles/app/php.ini`, `supervisord.conf`, `start-container`, `scheduler.sh` — container runtime config. Supervisor runs Octane; the `horizon` and `scheduler` programs ship commented out, enable them per project.
- `dockerfiles/mysql/Dockerfile` — the MySQL image.

The command aborts if a `dockerfiles/` directory already exists (there is no `--force`); remove it first to regenerate. Unlike the CI/CD workflow, these files are usually tuned per project after publishing.

Documentation
-------------

[](#documentation)

Publish the standard project documentation:

```
php artisan make:csgtdocs
```

This creates three files from company-wide templates:

- `README.md` — stack, local setup, frequent commands, CI/CD summary, plus clearly marked `EDIT`/`TODO` sections for the project's business domain.
- `AGENTS.md` — guidance for AI coding agents (the cross-tool standard read by Codex, Gemini CLI, Cursor, etc.): stack, CSGT conventions (commits, migrations, cancerbero, CRUD pattern, testing checklist, generated files), environment commands, plus editable project-context sections.
- `CLAUDE.md` — a two-line pointer that imports `AGENTS.md` for Claude Code, so the guidance lives in a single tool-agnostic file.

Project name, repository (for the CI badge), PHP and Node versions are auto-detected (`composer.json`, git remote, `.nvmrc`). Existing files are never overwritten unless `--force` is passed. After generating, search for the `EDIT`/`TODO` markers and fill in the project-specific sections.

OptionDefaultDescription`--php`auto-detected (`composer.json`)PHP version shown in the docs`--node`auto-detected (`.nvmrc`/`package.json`)Node version shown in the docs`--force`—Overwrite `README.md`/`CLAUDE.md` if presentBase scaffolding
----------------

[](#base-scaffolding)

Publish the base app structure expected by the package's admin utilities:

```
php artisan make:csgtutils
```

This creates the `app/Http/Controllers/Catalogs` and `app/Models/Menu` directories, and writes `app/Models/Menu/Menu.php` (an empty Eloquent model, namespaced to the app) that backs the [Menu](#menu) rendering below. Existing files are overwritten, so run it once when setting up a project rather than on an established codebase.

Package development
-------------------

[](#package-development)

Work targets the branch of the affected version (master is the current major). The test suite runs the scaffolding commands against a real Laravel skeleton via `orchestra/testbench`:

```
composer install
composer test
```

Every push runs the suite on GitHub Actions across this branch's PHP matrix (`.github/workflows/tests.yml`). Releases are tags: a fix on a version branch ships by tagging the next patch on that branch (Composer installs tags, not branches).

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance97

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 67.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 ~43 days

Recently: every ~0 days

Total

68

Last Release

16d ago

Major Versions

v5.0.1 → v9.0.02024-01-17

v9.0.8 → v10.0.02025-02-15

v8.0.12 → v10.0.62026-05-27

5.0.x-dev → v8.0.132026-07-31

8.x-dev → v10.0.112026-07-31

PHP version history (3 changes)v5.7.0PHP &gt;=7.0.0

6.0.0PHP &gt;=7.2

v5.0.1PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7926376?v=4)[csgt](/maintainers/csgt)[@csgt](https://github.com/csgt)

---

Top Contributors

[![jgalindosl](https://avatars.githubusercontent.com/u/66330140?v=4)](https://github.com/jgalindosl "jgalindosl (49 commits)")[![JuanCruzSL](https://avatars.githubusercontent.com/u/222065035?v=4)](https://github.com/JuanCruzSL "JuanCruzSL (15 commits)")[![hlca](https://avatars.githubusercontent.com/u/1301913?v=4)](https://github.com/hlca "hlca (4 commits)")[![adrianfulla](https://avatars.githubusercontent.com/u/84196543?v=4)](https://github.com/adrianfulla "adrianfulla (3 commits)")[![csgt](https://avatars.githubusercontent.com/u/7926376?v=4)](https://github.com/csgt "csgt (1 commits)")[![menene](https://avatars.githubusercontent.com/u/1200545?v=4)](https://github.com/menene "menene (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/csgt-utils/health.svg)

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

###  Alternatives

[stidges/country-flags

A small package to convert a country code to the corresponding country flag emoji

29279.7k4](/packages/stidges-country-flags)

PHPackages © 2026

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