├── .gitignore ├── Alpinejs ├── app.css ├── README.md ├── app.js └── package.json ├── Laravel └── 12.x │ ├── resources │ ├── css │ │ └── app.css │ └── js │ │ └── app.js │ ├── app │ ├── global_functions.php │ ├── Contracts │ │ └── ShouldNotQueue.php │ └── Providers │ │ └── AppServiceProvider.php │ ├── tests │ ├── TestCase.php │ ├── bootstrap.php │ ├── Unit │ │ ├── ExampleTest.php │ │ └── UnitTestCase.php │ ├── Exceptions │ │ └── DatabaseAccessException.php │ ├── Feature │ │ ├── ExampleTest.php │ │ └── FeatureTestCase.php │ ├── Integration │ │ └── IntegrationTestCase.php │ ├── Concerns │ │ ├── HasTodo.php │ │ ├── CreatesActingAs.php │ │ ├── AlertsUnwantedDBAccess.php │ │ └── DeepInspection.php │ └── External │ │ └── README.md │ ├── seeders │ ├── DevDataSeeder.php │ └── DatabaseSeeder.php │ ├── .env.example │ ├── README.md │ ├── database │ └── factories │ │ └── ExampleFactory.php │ └── composer.json ├── Sentry ├── composer.json ├── .env.example └── config │ └── sentry.php ├── Phpcsfixer ├── README.md ├── composer.json └── .php-cs-fixer.php ├── Docker ├── Database │ ├── Mysql9 │ │ ├── init │ │ │ └── make-test-db.sql │ │ └── docker-compose.yml │ └── Mysql8 │ │ └── docker-compose.yml ├── App │ └── Php8.4 │ │ ├── docker-php-ext-xdebug.ini │ │ ├── docker-compose.yml │ │ └── Dockerfile ├── Web │ └── Nginx1.27.x │ │ ├── Dockerfile │ │ ├── nginx.conf │ │ └── docker-compose.yml ├── Jobs │ └── Horizon5 │ │ ├── Dockerfile │ │ ├── docker-compose.yml │ │ └── entrypoint.sh ├── Cache │ └── Redis7 │ │ └── docker-compose.yml ├── Pdf │ └── Gotenberg8 │ │ └── docker-compose.yml ├── S3 │ └── Minio202504 │ │ └── docker-compose.yml └── README.md ├── Php ├── README.md └── 8.x │ └── USStateEnum.php ├── Phpstan ├── README.md ├── composer.json ├── phpstan.neon └── AuditManyToManyChanges.php ├── Composer ├── auth.example.json ├── README.md └── composer.json ├── Vite └── 6.x │ ├── README.md │ ├── package.json │ └── vite.config.js ├── README.md ├── Rector └── 2.x │ ├── composer.json │ └── rector.php ├── Phpunit └── 12.x │ ├── README.md │ ├── phpunit-external.xml │ └── phpunit.xml ├── Github ├── README.md └── workflows │ ├── production-merge.yml │ ├── deploy.yml │ ├── new-base-image.yml │ └── ci.yml ├── Horizon └── README.md ├── Volta └── README.md ├── Dnsmasq └── README.md └── Mkcert └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.vscode 3 | -------------------------------------------------------------------------------- /Alpinejs/app.css: -------------------------------------------------------------------------------- 1 | [x-cloak] { display: none !important; } 2 | -------------------------------------------------------------------------------- /Alpinejs/README.md: -------------------------------------------------------------------------------- 1 | # AlpineJS 2 | 3 | AlpineJS is used with Livewire. 4 | 5 | -------------------------------------------------------------------------------- /Laravel/12.x/resources/css/app.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss"; 2 | @source "../views"; 3 | -------------------------------------------------------------------------------- /Alpinejs/app.js: -------------------------------------------------------------------------------- 1 | import Alpine from 'alpinejs'; 2 | window.Alpine = Alpine; 3 | Alpine.start(); 4 | -------------------------------------------------------------------------------- /Alpinejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "alpinejs": "^3.4.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Sentry/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "sentry/sentry-laravel": "^4.15" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Phpcsfixer/README.md: -------------------------------------------------------------------------------- 1 | # PHP CS Fixer 2 | 3 | We have our own configuration and is configured in this process. 4 | -------------------------------------------------------------------------------- /Sentry/.env.example: -------------------------------------------------------------------------------- 1 | SENTRY_LARAVEL_DSN= 2 | SENTRY_SEND_DEFAULT_PII=true 3 | SENTRY_TRACES_SAMPLE_RATE=1.0 4 | -------------------------------------------------------------------------------- /Docker/Database/Mysql9/init/make-test-db.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE apptest; 2 | GRANT ALL PRIVILEGES ON *.* TO 'app'@'%'; 3 | -------------------------------------------------------------------------------- /Php/README.md: -------------------------------------------------------------------------------- 1 | # PHP Utilities 2 | 3 | These are useful PHP classes and utilities that may be nice to have in a project. 4 | -------------------------------------------------------------------------------- /Phpcsfixer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "nocompromises/php-cs-fixer-config": "^1.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Phpstan/README.md: -------------------------------------------------------------------------------- 1 | # PHPStan with Larastan 2 | 3 | Larastan is a plugin for PHPStan. 4 | 5 | PHPStan's mockery is also included here if necessary. 6 | -------------------------------------------------------------------------------- /Composer/auth.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic": { 3 | "domain-name.com": { 4 | "username": "", 5 | "password": "" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Laravel/12.x/app/global_functions.php: -------------------------------------------------------------------------------- 1 | setParallelConfig(\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()); 7 | -------------------------------------------------------------------------------- /Docker/Web/Nginx1.27.x/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.27.5-alpine3.21 2 | 3 | COPY nginx.conf /etc/nginx/conf.d/default.conf 4 | 5 | HEALTHCHECK --start-period=2s --timeout=3s --retries=50 CMD wget -O /dev/null -q -T 2 http://127.0.0.1/robots.txt || exit 1 6 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | get('/'); 12 | 13 | $response->assertStatus(200); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Docker/Jobs/Horizon5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/my-project/my-project.com-app-image-dev:latest 2 | 3 | STOPSIGNAL SIGTERM 4 | 5 | COPY entrypoint.sh /usr/local 6 | RUN chmod +x /usr/local/entrypoint.sh 7 | 8 | USER www-data 9 | 10 | HEALTHCHECK --start-period=2s CMD pgrep -f php\./app/artisan\.horizon | grep . || exit 1 11 | 12 | ENTRYPOINT ["/usr/local/entrypoint.sh"] 13 | -------------------------------------------------------------------------------- /Vite/6.x/README.md: -------------------------------------------------------------------------------- 1 | # Vite 6.x 2 | 3 | An example configuration is found in the `vite.config.js` file. 4 | 5 | This handles reading a local ssl file (from Mkcert), handles TailwindCSS and Laravel. 6 | 7 | Example but not limited to what's in package.json. 8 | 9 | Note the `my-project.test` entry in the `vite.config.js` file. This should be replaced with your domain. 10 | -------------------------------------------------------------------------------- /Laravel/12.x/README.md: -------------------------------------------------------------------------------- 1 | # Laravel Install 2 | 3 | ## Suggested Packages for Specific Usages 4 | 5 | Packages found to be useful over a large amount of projects, but not required, may be found in the composer.json of this folder. 6 | 7 | ## Scripts 8 | 9 | This composer.json file also has a suggested set of scripts and descriptions. They may or may not apply to all projects. 10 | -------------------------------------------------------------------------------- /Vite/6.x/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "dev": "vite", 4 | "build": "vite build", 5 | "test": "vitest", 6 | "test-with-coverage": "vitest run --coverage" 7 | }, 8 | "devDependencies": { 9 | "@tailwindcss/vite": "^4.1.11", 10 | "laravel-vite-plugin": "^1.3.0", 11 | "tailwindcss": "^4.1.11", 12 | "vite": "^6.3.5", 13 | "vitest": "^3.2.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Docker/Jobs/Horizon5/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: my-project 2 | 3 | services: 4 | jobs: 5 | container_name: "my-project-jobs" 6 | # Gitlab built `image: registry.gitlab.com/my-project/v3/app/jobs-image:latest` 7 | # Github built `image: ghcr.io/my-project/my-project.com-jobs-image:latest` 8 | working_dir: /app 9 | volumes: 10 | - .:/app 11 | restart: no 12 | 13 | networks: 14 | default: 15 | -------------------------------------------------------------------------------- /Laravel/12.x/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(DevDataSeeder::class); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Feature/FeatureTestCase.php: -------------------------------------------------------------------------------- 1 | withoutVite(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Phpstan/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "larastan/larastan": "^3.1", 4 | "phpstan/phpstan-mockery": "^2.0" 5 | }, 6 | "scripts": { 7 | "larastan": [ 8 | "@php vendor/bin/phpstan analyse -v" 9 | ] 10 | }, 11 | "scripts-descriptions": { 12 | "larastan": "Runs the PHPStan with Laravel plugin." 13 | }, 14 | "scripts-aliases": { 15 | "phpstan": ["larastan"] 16 | } 17 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project Tooling 2 | 3 | --- 4 | WIP WIP WIP WIP 5 | --- 6 | 7 | Consider this still a WIP and nothing should be copied directly. This is guidance. 8 | 9 | --- 10 | 11 | This project contains tooling and best practices for various Laravel and PHP projects. 12 | 13 | See individual folders and directories for instructions for tools. 14 | 15 | If there are differences between versions of the tooling, then major versioned directories are created. 16 | -------------------------------------------------------------------------------- /Docker/Web/Nginx1.27.x/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root /app/public; 4 | index index.php; 5 | 6 | if (!-e $request_filename) { 7 | rewrite ^.*$ /index.php last; 8 | } 9 | 10 | location ~ \.php$ { 11 | fastcgi_pass app:9000; 12 | fastcgi_index index.php; 13 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 14 | include fastcgi_params; 15 | fastcgi_read_timeout 300; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Docker/Jobs/Horizon5/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # see https://nckrtl.com/articles/how-to-make-laravel-horizon-work-perfectly-with-any-docker-image 4 | 5 | exec php /app/artisan horizon & 6 | 7 | HORIZON_PID=$! 8 | 9 | stop_horizon() { 10 | php /app/artisan horizon:terminate --wait 11 | exit 0 12 | } 13 | 14 | trap 'stop_horizon' TERM 15 | 16 | # This wait ensures the script itself does not exit until Horizon process is done 17 | wait $HORIZON_PID 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Integration/IntegrationTestCase.php: -------------------------------------------------------------------------------- 1 | markTestIncomplete(sprintf('Todo: %s::%s', $caller['class'], $caller['function'])); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Unit/UnitTestCase.php: -------------------------------------------------------------------------------- 1 | alertUnwantedDBAccess(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Laravel/12.x/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerGlobalFunctions(); // this is an example of how to load global functions that don't require function_exists() 14 | } 15 | 16 | protected function registerGlobalFunctions(): void 17 | { 18 | require_once app_path('/global_functions.php'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Phpstan/phpstan.neon: -------------------------------------------------------------------------------- 1 | includes: 2 | - ./vendor/larastan/larastan/extension.neon 3 | - ./vendor/phpstan/phpstan-mockery/extension.neon 4 | 5 | rules: 6 | - App\AuditManyToManyChanges # optional rule for when using auditing package 7 | 8 | parameters: 9 | tmpDir: .phpstan.cache # add to .gitignore 10 | 11 | paths: 12 | - app 13 | - routes 14 | - tests 15 | 16 | level: 5 17 | 18 | # Larastan configuration 19 | noEnvCallsOutsideOfConfig: true 20 | checkModelAppends: true 21 | 22 | editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' 23 | -------------------------------------------------------------------------------- /Phpunit/12.x/README.md: -------------------------------------------------------------------------------- 1 | # PHPUnit 2 | 3 | PHPUnit is used to unit test PHP and Laravel code. 4 | 5 | See `phpunit.xml` for an example of how to configure a Laravel project. 6 | 7 | Note that our standard PHPUnit configuration never hits external services. 8 | 9 | > Review your `.env` and add a "do-not-use" for every single value that enables communication with an external service 10 | 11 | External tests can be launched with a call to the external phpunit-external.xml file. This will exercise external calls. 12 | 13 | > Make sure your local .env has the correct values for running external tests 14 | -------------------------------------------------------------------------------- /Laravel/12.x/resources/js/app.js: -------------------------------------------------------------------------------- 1 | /** if going to use livewire and configure some alpine plugins, do it like this **/ 2 | 3 | import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm'; 4 | import Autosize from '@marcreichel/alpine-autosize'; /** example **/ 5 | 6 | Alpine.plugin(Autosize); 7 | 8 | Alpine.magic('autofocus', () => () => { 9 | Alpine.nextTick(() => document.querySelector('[autofocus]').focus()); 10 | }); 11 | 12 | Livewire.start(); 13 | 14 | /** Import images so you can access them with Vite::asset() **/ 15 | import.meta.glob([ 16 | '../images/**', 17 | ]); 18 | -------------------------------------------------------------------------------- /Docker/Pdf/Gotenberg8/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: my-project 2 | 3 | services: 4 | pdf: 5 | container_name: "my-project-pdf" 6 | image: gotenberg/gotenberg:8.23.0 7 | environment: 8 | - "CHROMIUM_IGNORE_CERTIFICATE_ERRORS=true" 9 | extra_hosts: 10 | - "my-project.test:host-gateway" # required for loading vite assets - if configured to run at .test 11 | healthcheck: 12 | test: ["CMD", "curl", "--fail", "http://localhost:3000/health"] 13 | start_period: 3s 14 | timeout: 2s 15 | retries: 50 16 | 17 | networks: 18 | default: 19 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Concerns/CreatesActingAs.php: -------------------------------------------------------------------------------- 1 | actingAs = User::factory()->create($properties); 23 | $this->actingAs($this->actingAs); 24 | 25 | return $this->actingAs; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Concerns/AlertsUnwantedDBAccess.php: -------------------------------------------------------------------------------- 1 | sql); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Github/README.md: -------------------------------------------------------------------------------- 1 | # Github 2 | 3 | Use `.github/workflows/*` files as a base for your project. 4 | 5 | The ci one contains an example of how to run tests and functionality in your project. You may or may not use all of the features. 6 | 7 | The new-base-image one is for creating and registering docker containers into the GH registry. 8 | 9 | Deploy is an envoyer-based deploy example. 10 | 11 | Production merge makes it easy from the GitHub UI to merge `develop` into `main`, which could trigger a production deploy. 12 | - It requires you to generate a personal access token with basic repo read/write permissions 13 | - Then set up `GH_REGISTRY_PAT` as a secret in your repo/org using the newly-generated token 14 | -------------------------------------------------------------------------------- /Docker/Database/Mysql9/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: my-project 2 | 3 | services: 4 | database: 5 | container_name: "my-project-database" 6 | image: mysql:9.0.1 7 | volumes: 8 | - database-data:/var/lib/mysql 9 | - ./docker/database/init:/docker-entrypoint-initdb.d 10 | environment: 11 | MYSQL_ROOT_PASSWORD: password 12 | MYSQL_DATABASE: app 13 | MYSQL_USER: app 14 | MYSQL_PASSWORD: app 15 | restart: unless-stopped 16 | healthcheck: 17 | test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD 18 | start_period: 3s 19 | timeout: 2s 20 | retries: 50 21 | 22 | volumes: 23 | database-data: 24 | 25 | networks: 26 | default: 27 | -------------------------------------------------------------------------------- /Horizon/README.md: -------------------------------------------------------------------------------- 1 | # Laravel Horizon 2 | 3 | The horizon container can be found in the Docker configuration directory under `jobs`. These instructions are for usage of the container after it is running. 4 | 5 | ## Running Horizon 6 | 7 | The `.env.example` file sets up queues to run with the `redis` configuration, and we use Horizon to manage the queue workers. 8 | 9 | By default `docker compose up` will start a Horizon worker in a separate container. If, for some reason you want to stop 10 | Horizon, you can stop that container with `docker compose stop horizon`. 11 | 12 | > Be aware, if you're changing code and also interacting with the queues, you will need to restart horizon in order to 13 | > have the new code loaded: `docker compose restart horizon` 14 | -------------------------------------------------------------------------------- /Volta/README.md: -------------------------------------------------------------------------------- 1 | # Node environment with Volta 2 | 3 | The best option to ensure you're using the correct versions of Node and npm with this project is to install [Volta](https://volta.sh). This allows us to run the exact version of node and npm on the local host machine which allows quicker responsiveness than in a Docker container. 4 | 5 | Volta will read the pinned versions of Node and npm from the `package.json` so you can be sure you're using the correct versions. 6 | 7 | To install Volta, follow the instructions on the [Volta website](https://volta.sh). 8 | 9 | To pin the versions of Node and npm, run: 10 | 11 | ``` 12 | volta pin node && volta pin npm 13 | ``` 14 | 15 | To install specific versions of Node and npm, run: 16 | 17 | ``` 18 | volta install node@22 19 | ``` 20 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/External/README.md: -------------------------------------------------------------------------------- 1 | # External Tests 2 | 3 | Our normal test suite is set up to force mocking any external services. But it's useful to do a real call to an external 4 | service to verify it's working as expected. We separate these tests out into an `external` test suite, so we can run them 5 | only as-needed. 6 | 7 | The configuration is managed by the `phpunit-external.xml` file and tests are executed by running `docker/bin/composer test-external`. 8 | 9 | Usually each external service will have one corresponding test file in this folder. 10 | 11 | For every external service, make sure your local `.env` has proper credentials setup for a test environment. Add an 12 | explicit row in `phpunit-external.xml` for each environment variable, and comment it out, to make it clear this needs 13 | to be setup. 14 | -------------------------------------------------------------------------------- /Laravel/12.x/database/factories/ExampleFactory.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | class ExampleFactory extends Factory 14 | { 15 | public function definition(): array 16 | { 17 | return [ 18 | 'email' => $this->faker->unique()->safeEmail(), 19 | ]; 20 | } 21 | 22 | // state example 23 | public function withoutPassword(): static 24 | { 25 | return $this->state(['password' => null]); 26 | } 27 | 28 | // callback example 29 | public function programmer(): static 30 | { 31 | return $this->afterCreating(fn(User $user) => $user->assignRole(Role::PROGRAMMER)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Vite/6.x/vite.config.js: -------------------------------------------------------------------------------- 1 | import laravel from 'laravel-vite-plugin' 2 | import { defineConfig } from 'vite' 3 | import fs from 'fs'; 4 | import tailwindcss from "@tailwindcss/vite"; 5 | 6 | export default defineConfig(({ mode }) => { 7 | const config = { 8 | plugins: [ 9 | tailwindcss(), 10 | laravel({ 11 | input: ['resources/css/app.css', 'resources/js/app.js'], 12 | refresh: true, 13 | }), 14 | ], 15 | }; 16 | 17 | if (mode === "development") { 18 | config.server = { 19 | host: true, 20 | https: { 21 | key: fs.readFileSync("docker/vite/key.pem"), 22 | cert: fs.readFileSync("docker/vite/cert.pem"), 23 | }, 24 | hmr: { 25 | host: "my-project.test" 26 | } 27 | }; 28 | } 29 | 30 | return config; 31 | }); 32 | -------------------------------------------------------------------------------- /Dnsmasq/README.md: -------------------------------------------------------------------------------- 1 | # DNS resolution 2 | 3 | With OrbStack, you can expect that the `.local` domain is mapped locally. However, you may want additional things to be mapped locally. 4 | 5 | One easy way to do this for the entire `.test` top-level domain, is to run a lightweight tool called `dnsmasq`. 6 | 7 | You can install it via Homebrew on a Mac with: `brew install dnsmasq`. 8 | 9 | > If you've ever setup Valet, it already installed dnsmasq for you. You can verify if it's already installed by running 10 | > `brew services` and see if `dnsmasq` is listed. 11 | 12 | To confirm this is set up for your `.test` domain, check the content of `/opt/homebrew/etc/dnsmasq.d/test.conf` - or create it if necessary. 13 | 14 | ``` 15 | address=/.test/127.0.0.1 16 | ``` 17 | 18 | It may be required to restart dnsmasq for the changes to take effect. 19 | 20 | ``` 21 | brew services restart dnsmasq 22 | ``` 23 | -------------------------------------------------------------------------------- /Docker/S3/Minio202504/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: my-project 2 | 3 | services: 4 | s3: 5 | container_name: "my-project-s3" 6 | image: minio/minio:RELEASE.2025-04-22T22-12-26Z 7 | volumes: 8 | - ./storage/s3:/data 9 | ports: 10 | - "9000:9000" 11 | - "9998:9998" 12 | environment: 13 | - "MINIO_ROOT_USER=user" 14 | - "MINIO_ROOT_PASSWORD=password" 15 | command: "server /data --console-address :9998" 16 | restart: unless-stopped 17 | healthcheck: 18 | test: ["CMD", "curl", "--fail", "http://localhost:9000/minio/health/live"] 19 | start_period: 3s 20 | timeout: 2s 21 | retries: 50 22 | labels: 23 | - dev.orbstack.http-port=9000 # this gives you https://s3.my-project.orb.local/bucket to surf to 24 | 25 | networks: 26 | default: 27 | -------------------------------------------------------------------------------- /Composer/README.md: -------------------------------------------------------------------------------- 1 | # Composer 2 | 3 | This is the general Composer configuration documentation. You may find specific configuration examples in the documentation folders of the tooling. 4 | 5 | ## Running Other Scripts 6 | 7 | Some scripts use a short command, like `phpcs`, but others use the `@php` alias, like `larastan`. The difference is subtle, 8 | but using `@php` tells composer to use the same php process composer itself is already using. This is especially important 9 | if you want composer's memory limit config to apply. 10 | 11 | ## Licenses 12 | 13 | If this project uses a paid Composer package, like Nova, authorize the license with the `auth.json` file. 14 | 15 | To set that up, create an `auth.json` file from the example: 16 | 17 | `cp auth.json.example auth.json` 18 | 19 | And then open `auth.json` and fill out the username and password values. 20 | 21 | Finally, add `auth.json` to your `.gitignore` file. 22 | -------------------------------------------------------------------------------- /Github/workflows/production-merge.yml: -------------------------------------------------------------------------------- 1 | name: Production Merge 2 | 3 | on: workflow_dispatch 4 | 5 | permissions: 6 | contents: write 7 | actions: write 8 | 9 | jobs: 10 | Merge: 11 | runs-on: ubuntu-latest 12 | 13 | env: 14 | MAIN_BRANCH: main 15 | DEVELOP_BRANCH: develop 16 | 17 | steps: 18 | - name: Checkout Develop ( ${{env.DEVELOP_BRANCH}} ) 19 | uses: actions/checkout@v4 20 | with: 21 | ref: ${{env.DEVELOP_BRANCH}} 22 | fetch-depth: 0 # checkout the entire history 23 | persist-credentials: true 24 | token: ${{ secrets.GH_REGISTRY_PAT }} 25 | 26 | - name: Set Git credentials 27 | run: | 28 | git config user.name "${{ github.actor }}" 29 | git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" 30 | 31 | - name: Execute production merge 32 | run: | 33 | git checkout $MAIN_BRANCH 34 | git merge $DEVELOP_BRANCH 35 | git push origin $MAIN_BRANCH 36 | -------------------------------------------------------------------------------- /Docker/Database/Mysql8/docker-compose.yml: -------------------------------------------------------------------------------- 1 | name: my-project 2 | 3 | services: 4 | database: 5 | container_name: "my-project-database" 6 | image: mysql:8.0.35 7 | volumes: 8 | - database-data:/var/lib/mysql 9 | - ./docker/database/init:/docker-entrypoint-initdb.d 10 | environment: 11 | - MYSQL_ROOT_PASSWORD=password 12 | - MYSQL_DATABASE=app # update .env and .env.example if you change any of these values 13 | - MYSQL_USER=app 14 | - MYSQL_PASSWORD=app 15 | command: 16 | - "--character-set-server=utf8mb4" 17 | - "--collation-server=utf8mb4_unicode_ci" 18 | - "--default-authentication-plugin=mysql_native_password" 19 | restart: unless-stopped 20 | healthcheck: 21 | test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD 22 | start_period: 3s 23 | timeout: 2s 24 | retries: 50 25 | 26 | volumes: 27 | database-data: 28 | 29 | networks: 30 | default: 31 | -------------------------------------------------------------------------------- /Composer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nocompromises/my-project", 3 | "type": "project", 4 | "license": "proprietary", 5 | "require": { 6 | "php": "^8.4", 7 | "ext-pdo": "*", 8 | "ext-redis": "^6.0" 9 | }, 10 | "require-dev": { 11 | "roave/security-advisories": "dev-latest" 12 | }, 13 | "scripts": { 14 | "lint": [ 15 | "echo \"No lints configured yet\"" 16 | ], 17 | "test": [ 18 | "echo \"No tests configured yet\"" 19 | ], 20 | "ci": [ 21 | "@composer lint", 22 | "@composer test" 23 | ] 24 | }, 25 | "config": { 26 | "optimize-autoloader": true, 27 | "preferred-install": "dist", 28 | "sort-packages": true, 29 | "allow-plugins": {} 30 | }, 31 | "minimum-stability": "stable", 32 | "prefer-stable": true, 33 | "scripts-descriptions": { 34 | "lint": "Runs all of the linters", 35 | "test": "Runs all of the unit tests", 36 | "ci": "Runs tasks that should be done for integration: code sniffing, static analysis, and tests", 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Docker/App/Php8.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4.8-fpm-alpine3.22 AS base 2 | 3 | RUN apk add --no-cache $PHPIZE_DEPS \ 4 | freetype-dev \ 5 | libpng-dev \ 6 | libjpeg-turbo-dev \ 7 | libzip-dev \ 8 | zip 9 | 10 | RUN pecl install redis-6.2.0 \ 11 | && rm -rf /tmp/pear 12 | 13 | # the install command for an extension must immediately follow the configure command 14 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ 15 | && docker-php-ext-install gd \ 16 | && docker-php-ext-install pdo_mysql \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-enable redis \ 19 | && docker-php-ext-install zip 20 | 21 | COPY --from=composer:2.8.9 /usr/bin/composer /usr/bin/composer 22 | 23 | HEALTHCHECK --start-period=2s CMD pgrep -f php-fpm\:\.pool | grep . || exit 1 24 | 25 | FROM base AS dev 26 | 27 | # XDebug functionality for local dev (XDebug requires linux-headers to compile/build) 28 | RUN apk add --no-cache linux-headers \ 29 | && pecl install xdebug-3.4.3 \ 30 | && rm -rf /tmp/pear \ 31 | && docker-php-ext-enable xdebug 32 | COPY docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 33 | -------------------------------------------------------------------------------- /Github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_run: 6 | workflows: 7 | - CI 8 | types: 9 | - completed 10 | branches: 11 | - main 12 | - develop 13 | 14 | jobs: 15 | deploy: 16 | name: Deploy 17 | runs-on: ubuntu-24.04 18 | 19 | if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} 20 | 21 | steps: 22 | 23 | - name: Deploy to staging if develop branch 24 | if: ${{(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/develop') || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'develop')}} 25 | run: curl -s ${{ secrets.ENVOYER_STAGING_TRIGGER }} 26 | 27 | - name: Deploy to prod if main branch 28 | if: ${{(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')}} 29 | run: | 30 | curl -s ${{ secrets.ENVOYER_PROD_TRIGGER }} 31 | curl -s ${{ secrets.ENVOYER_PROD_ASSET_HEALTH_TRIGGER }} 32 | -------------------------------------------------------------------------------- /Phpstan/AuditManyToManyChanges.php: -------------------------------------------------------------------------------- 1 | name; 27 | 28 | if (!in_array($syncMethodCall->name, ['attach', 'detach', 'sync'])) { 29 | return []; 30 | } 31 | 32 | return [ 33 | RuleErrorBuilder::message('Auditing missing for many-to-many relationship alteration.') 34 | ->identifier('app.auditmanytomanychanges') 35 | ->build(), 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Mkcert/README.md: -------------------------------------------------------------------------------- 1 | # Setting up an SSL certificate locally 2 | 3 | Orbstack provides automatic TLS certificates for `.local` domains, but we may also need other certificates locally. For example, Vite needs one. 4 | 5 | To do this, we'll use `mkcert`, a simple tool for making locally-trusted development certificates. 6 | 7 | To install on Mac with Homebrew, you can run: 8 | 9 | `brew install mkcert nss` 10 | 11 | For other platforms or configurations, you can refer to the [mkcert README](https://github.com/FiloSottile/mkcert) 12 | 13 | Once `mkcert` is installed, we need to generate our local development root certificate authority: 14 | 15 | > If you've used `mkcert` before, you can skip this step 16 | > This command will likely prompt you for administrator access on macOS 17 | 18 | `mkcert -install` 19 | 20 | Then, generate the certificates for this project and put them into a location you can use. 21 | 22 | For a standard NC Docker project, you might do this: 23 | 24 | `mkcert -cert-file docker/vite/ssl.pem -key-file docker/vite/key.pem my-project.test` 25 | 26 | In this case, the `my-project.test` is mapped to localhost using a /etc/hosts file or dnsmasq. Check the Vite configuration on how to use this file. 27 | -------------------------------------------------------------------------------- /Laravel/12.x/tests/Concerns/DeepInspection.php: -------------------------------------------------------------------------------- 1 | getMethod($methodName); 19 | $method->setAccessible(true); 20 | 21 | return empty($arguments) ? $method->invoke($object) : $method->invokeArgs($object, $arguments); 22 | } 23 | } 24 | 25 | if (!function_exists('getProperty')) { 26 | /** 27 | * Get protected or private property 28 | * 29 | * @note if you put a @throws on this, it'll start generating "non caught exceptions" in all of the tests in your IDE 30 | */ 31 | function getProperty($object, $propertyName) 32 | { 33 | $reflection = new \ReflectionClass($object); 34 | $property = $reflection->getProperty($propertyName); 35 | $property->setAccessible(true); 36 | 37 | return $property->getValue($object); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Phpunit/12.x/phpunit-external.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | ./tests/External 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Rector/2.x/rector.php: -------------------------------------------------------------------------------- 1 | withCache( 11 | cacheDirectory: '.rector-cache', // Add to .gitignore 12 | cacheClass: FileCacheStorage::class, 13 | ) 14 | ->withPaths([ 15 | __DIR__ . '/app', 16 | __DIR__ . '/config', 17 | __DIR__ . '/public', 18 | __DIR__ . '/resources', 19 | __DIR__ . '/routes', 20 | __DIR__ . '/tests', 21 | ]) 22 | ->withPhpSets(php84: true) 23 | ->withSets([ 24 | LaravelSetList::LARAVEL_120, 25 | ]) 26 | ->withSkip([ 27 | \Rector\Php81\Rector\Array_\FirstClassCallableRector::class => [ 28 | __DIR__ . '/routes/api.php', 29 | __DIR__ . '/routes/web.php', 30 | ], 31 | \Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector::class, 32 | \Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class => [ 33 | __DIR__ . '/tests', // we like unused variables in tests for clear naming 34 | ], 35 | ]) 36 | ->withRules([ 37 | // will add these as the project matures 38 | ]) 39 | ->withTypeCoverageLevel(1) // max level is 36 40 | ->withDeadCodeLevel(1); // max level is 50 41 | -------------------------------------------------------------------------------- /Phpunit/12.x/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | ./tests/Unit 13 | 14 | 15 | ./tests/Integration 16 | 17 | 18 | ./tests/Feature 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ./app 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker 2 | 3 | Preferred runtime for Docker is [OrbStack](https://orbstack.dev). 4 | 5 | You can check individual folders for portions of a `docker-compose.yml` file - to build your final version for the unique project. 6 | 7 | ## Storing Containers in a Registry 8 | 9 | When possible, we want to store our containers in a registry. This is great for development environment quality - as they're all the same. In addition, this configuration could be expanded for production deploys as well. 10 | 11 | ### GitLab Docker Container Registry Setup 12 | 13 | * Create a [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) in Gitlab. 14 | * Gitlab defaults to a one-month expiration. You probably want to change to the maximum 1-year expiration, so you don't need to regenerate as frequently. 15 | * Minimum required scopes: `read_registry`, `write_registry` 16 | * Authenticate locally `docker login registry.gitlab.com` 17 | * Provide your gitlab username 18 | * The password is the personal access token you created 19 | 20 | ## Building Base Images 21 | 22 | When possible, use a workflow to build these images. You can see an example of that in the Github folder. 23 | 24 | If necessary to build them by hand, follow these steps: 25 | 26 | > Any changes to the `docker/app` or `docker/web` folders would require a new base image to be built. 27 | 28 | > If you've never built multi-platform images before, you might need to set that up first. 29 | > You'll know if you get an error like `ERROR: Multi-platform build is not supported for the docker driver.` 30 | > * `docker buildx create --name multiplaftorm --use` 31 | > * `docker buildx install` 32 | 33 | ### Building for GitLab 34 | 35 | ```bash 36 | # web image 37 | docker build ./docker/web \ 38 | --platform linux/amd64,linux/arm64 \ 39 | --tag registry.gitlab.com/my-project/v3/app/web-image:latest \ 40 | --push 41 | 42 | # app image 43 | docker build ./docker/app \ 44 | --target base \ 45 | --platform linux/amd64,linux/arm64 \ 46 | --tag registry.gitlab.com/my-project/v3/app/app-image:latest \ 47 | --push 48 | 49 | # app-dev image 50 | docker build ./docker/app \ 51 | --target dev \ 52 | --platform linux/amd64,linux/arm64 \ 53 | --tag registry.gitlab.com/my-project/v3/app/app-image-dev:latest \ 54 | --push 55 | ``` 56 | -------------------------------------------------------------------------------- /Laravel/12.x/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "UNLICENSED", 3 | "require": { 4 | "league/flysystem-aws-s3-v3": "^3.0", 5 | "maatwebsite/excel": "^3.1", 6 | "owen-it/laravel-auditing": "^14.0", 7 | "robsontenorio/mary": "^2.4", 8 | "spatie/laravel-permission": "^6.16", 9 | "spatie/laravel-query-builder": "^6.3" 10 | }, 11 | "require-dev": { 12 | "barryvdh/laravel-ide-helper": "^3.5", 13 | "roave/security-advisories": "dev-latest" 14 | }, 15 | "scripts": { 16 | "ci": [ 17 | "@composer phpcs", 18 | "@composer rector", 19 | "@composer larastan", 20 | "@composer test" 21 | ], 22 | "ci-cache": [ 23 | "@php artisan view:cache", 24 | "@php artisan route:cache" 25 | ], 26 | "ide-helper-update": [ 27 | "@php artisan clear-compiled", 28 | "@php artisan ide-helper:generate", 29 | "@php artisan ide-helper:meta", 30 | "@php artisan ide-helper:models --write --reset", 31 | "@composer phpcs-fix" 32 | ], 33 | "larastan": [ 34 | "@php vendor/bin/phpstan analyse -v" 35 | ], 36 | "laravel-cache": [ 37 | "@php artisan view:cache" 38 | ], 39 | "phpcs": [ 40 | "php-cs-fixer check -v" 41 | ], 42 | "phpcs-fix": [ 43 | "php-cs-fixer fix" 44 | ], 45 | "post-autoload-dump": [ 46 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 47 | "@php artisan package:discover --ansi" 48 | ], 49 | "post-update-cmd": [ 50 | "@php artisan clear-compiled", 51 | "@php artisan ide-helper:generate", 52 | "@php artisan ide-helper:meta", 53 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 54 | ], 55 | "prod-cache": [ 56 | "@php artisan config:cache", 57 | "@php artisan view:cache", 58 | "@php artisan route:cache", 59 | "@php artisan orbit:cache", 60 | "@php artisan filament:optimize" 61 | ], 62 | "rector": [ 63 | "@php vendor/bin/rector --dry-run" 64 | ], 65 | "rector-fix": [ 66 | "@php vendor/bin/rector" 67 | ], 68 | "test": [ 69 | "phpunit" 70 | ] 71 | }, 72 | "extra": { 73 | "laravel": { 74 | "dont-discover": [ 75 | "laravel/telescope" 76 | ] 77 | } 78 | }, 79 | "scripts-descriptions": { 80 | "ci": "These are the CI tests and code standards tools that run.", 81 | "ci-cache": "This runs all of the Laravel cache functionality besides config. (Config is off because that is part of a container start up using ENV vars.)", 82 | "larastan": "Runs the PHPStan with Laravel plugin.", 83 | "phpcs": "The PHP Code Sniffer tester.", 84 | "phpcs-fix": "Automatically fixes any sniffs it can.", 85 | "prod-cache": "Caching that should be run in production for full optimization.", 86 | "rector": "Runs Rector and reports errors", 87 | "rector-fix": "Runs Rector and automatically fixes errors", 88 | "test": "PHPUnit tests for Laravel." 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Github/workflows/new-base-image.yml: -------------------------------------------------------------------------------- 1 | name: New Base Docker Image to GH Registry 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | image: 7 | type: choice 8 | required: true 9 | description: Which image to build 10 | options: 11 | - web 12 | - app 13 | - app-dev 14 | - jobs 15 | 16 | jobs: 17 | build-image: 18 | name: Build image 19 | runs-on: ubuntu-24.04 20 | 21 | steps: 22 | - name: Code checkout 23 | uses: actions/checkout@v4 24 | 25 | - name: Set up Docker Buildx 26 | uses: docker/setup-buildx-action@v3 27 | 28 | - name: Log in to Github Container Registry 29 | uses: docker/login-action@v3 30 | with: 31 | registry: ghcr.io 32 | username: ${{ vars.GH_REGISTRY_USERNAME }} 33 | password: ${{ secrets.GH_REGISTRY_PAT }} 34 | 35 | - name: Build and push Web 36 | if: ${{ inputs.image == 'web' }} 37 | uses: docker/build-push-action@v6 38 | with: 39 | platforms: linux/amd64,linux/arm64 40 | provenance: false 41 | context: ./docker/web 42 | push: true 43 | tags: | 44 | ghcr.io/my-project/my-project.com-web-image:${{ github.sha }} 45 | ghcr.io/my-project/my-project.com-web-image:latest 46 | 47 | - name: Build and push app 48 | if: ${{ inputs.image == 'app' }} 49 | uses: docker/build-push-action@v6 50 | with: 51 | platforms: linux/amd64,linux/arm64 52 | provenance: false 53 | context: ./docker/app 54 | target: base 55 | push: true 56 | cache-to: type=gha 57 | cache-from: type=gha 58 | tags: | 59 | ghcr.io/my-project/my-project.com-app-image:${{ github.sha }} 60 | ghcr.io/my-project/my-project.com-app-image:latest 61 | 62 | - name: Build and push app-dev 63 | if: ${{ inputs.image == 'app-dev' }} 64 | uses: docker/build-push-action@v6 65 | with: 66 | platforms: linux/amd64,linux/arm64 67 | provenance: false 68 | context: ./docker/app 69 | target: dev 70 | cache-to: type=gha 71 | cache-from: type=gha 72 | push: true 73 | tags: | 74 | ghcr.io/my-project/my-project.com-app-image-dev:${{ github.sha }} 75 | ghcr.io/my-project/my-project.com-app-image-dev:latest 76 | 77 | - name: Build and push jobs 78 | if: ${{ inputs.image == 'jobs' }} 79 | uses: docker/build-push-action@v6 80 | with: 81 | platforms: linux/amd64,linux/arm64 82 | provenance: false 83 | context: ./docker/jobs 84 | push: true 85 | cache-to: type=gha 86 | cache-from: type=gha 87 | tags: | 88 | ghcr.io/my-project/my-project.com-jobs-image:${{ github.sha }} 89 | ghcr.io/my-project/my-project.com-jobs-image:latest 90 | -------------------------------------------------------------------------------- /Github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Default Project CI 2 | 3 | on: push 4 | 5 | jobs: 6 | code-standards-and-tests: 7 | name: Code Standards and Tests 8 | runs-on: ubuntu-24.04 9 | 10 | if: "!contains(github.event.head_commit.message, '[no-ci]')" 11 | 12 | env: 13 | PROJECT_NAME: my-project 14 | 15 | steps: 16 | - name: Code checkout 17 | uses: actions/checkout@v4 18 | 19 | - name: Setup default environment 20 | run: cp .env.example .env 21 | 22 | - name: Log in to Github Container Registry 23 | uses: docker/login-action@v3 24 | with: 25 | registry: ghcr.io 26 | username: ${{ vars.GH_REGISTRY_USERNAME }} 27 | password: ${{ secrets.GH_REGISTRY_PAT }} 28 | 29 | - name: Build Docker containers and start them 30 | run: docker compose up app database -d --wait 31 | 32 | - name: Cache composer dependencies 33 | uses: actions/cache@v4 34 | with: 35 | path: vendor 36 | key: composer-${{ hashFiles('composer.lock') }} 37 | 38 | - name: Cache composer dependencies 39 | uses: actions/cache@v4 40 | with: 41 | path: vendor 42 | key: composer-${{ hashFiles('composer.lock') }} 43 | 44 | - name: Install PHP Dependencies 45 | run: docker exec "$PROJECT_NAME-app" /usr/bin/env sh -c "COMPOSER_ALLOW_SUPERUSER=1 composer install --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader" 46 | 47 | - name: CI Cache 48 | run: docker exec "$PROJECT_NAME-app" composer run ci-cache 49 | 50 | - name: Cache npm dependencies 51 | uses: actions/cache@v4 52 | with: 53 | path: node_modules 54 | key: npm-${{ hashFiles('package-lock.json') }} 55 | 56 | - name: Set up Volta to manage Node/Npm versions 57 | uses: volta-cli/action@v4 58 | 59 | - name: Install JS dependencies 60 | run: npm install 61 | 62 | - name: Build JS dependencies 63 | run: npm run build 64 | 65 | - name: Run JS ESLint 66 | run: npm run lint 67 | 68 | - name: Run JS test suite 69 | run: LARAVEL_BYPASS_ENV_CHECK=1 npm test 70 | 71 | 72 | - name: Cache Larastan result cache 73 | uses: actions/cache@v4 74 | with: 75 | path: .phpstan.cache 76 | key: "phpstan-result-cache-${{ github.run_id }}" # always unique key - always writes a new cache 77 | restore-keys: | # prefix allows it to use previous cache as starting point 78 | phpstan-result-cache- 79 | 80 | - name: Cache php-cs-fixer result cache 81 | uses: actions/cache@v4 82 | with: 83 | path: .php-cs-fixer.cache 84 | key: "php-cs-fixer-result-cache-${{ github.run_id }}" # always unique key - always writes a new cache 85 | restore-keys: | # prefix allows it to use previous cache as starting point 86 | php-cs-fixer-result-cache- 87 | 88 | - name: Run CI tools 89 | run: docker exec "$PROJECT_NAME-app" /usr/bin/env sh -c "COMPOSER_MEMORY_LIMIT=-1 composer ci" 90 | 91 | # - name: Deploy to staging if develop branch 92 | # if: github.ref == 'refs/heads/develop' 93 | # run: curl -s ${{ secrets.ENVOYER_STAGING_TRIGGER }} 94 | # 95 | # - name: Deploy to prod if main branch 96 | # if: github.ref == 'refs/heads/main' 97 | # run: curl -s ${{ secrets.ENVOYER_PROD_TRIGGER }} 98 | -------------------------------------------------------------------------------- /Php/8.x/USStateEnum.php: -------------------------------------------------------------------------------- 1 | 'Alabama', 65 | self::AK => 'Alaska', 66 | self::AZ => 'Arizona', 67 | self::AR => 'Arkansas', 68 | self::CA => 'California', 69 | self::CO => 'Colorado', 70 | self::CT => 'Connecticut', 71 | self::DE => 'Delaware', 72 | self::DC => 'District of Columbia', 73 | self::FL => 'Florida', 74 | self::GA => 'Georgia', 75 | self::HI => 'Hawaii', 76 | self::ID => 'Idaho', 77 | self::IL => 'Illinois', 78 | self::IN => 'Indiana', 79 | self::IA => 'Iowa', 80 | self::KS => 'Kansas', 81 | self::KY => 'Kentucky', 82 | self::LA => 'Louisiana', 83 | self::ME => 'Maine', 84 | self::MD => 'Maryland', 85 | self::MA => 'Massachusetts', 86 | self::MI => 'Michigan', 87 | self::MN => 'Minnesota', 88 | self::MS => 'Mississippi', 89 | self::MO => 'Missouri', 90 | self::MT => 'Montana', 91 | self::NE => 'Nebraska', 92 | self::NV => 'Nevada', 93 | self::NH => 'New Hampshire', 94 | self::NJ => 'New Jersey', 95 | self::NM => 'New Mexico', 96 | self::NY => 'New York', 97 | self::NC => 'North Carolina', 98 | self::ND => 'North Dakota', 99 | self::OH => 'Ohio', 100 | self::OK => 'Oklahoma', 101 | self::OR => 'Oregon', 102 | self::PA => 'Pennsylvania', 103 | self::RI => 'Rhode Island', 104 | self::SC => 'South Carolina', 105 | self::SD => 'South Dakota', 106 | self::TN => 'Tennessee', 107 | self::TX => 'Texas', 108 | self::UT => 'Utah', 109 | self::VT => 'Vermont', 110 | self::VA => 'Virginia', 111 | self::WA => 'Washington', 112 | self::WV => 'West Virginia', 113 | self::WI => 'Wisconsin', 114 | self::WY => 'Wyoming', 115 | }; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Sentry/config/sentry.php: -------------------------------------------------------------------------------- 1 | env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), 18 | 19 | // @see https://spotlightjs.com/ 20 | // 'spotlight' => env('SENTRY_SPOTLIGHT', false), 21 | 22 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#logger 23 | // 'logger' => Sentry\Logger\DebugFileLogger::class, // By default this will log to `storage_path('logs/sentry.log')` 24 | 25 | // The release version of your application 26 | // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) 27 | 'release' => env('SENTRY_RELEASE'), 28 | 29 | // When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`) 30 | 'environment' => env('SENTRY_ENVIRONMENT'), 31 | 32 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample_rate 33 | 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float) env('SENTRY_SAMPLE_RATE'), 34 | 35 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces_sample_rate 36 | 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), 37 | 38 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate 39 | 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), 40 | 41 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#enable_logs 42 | 'enable_logs' => true, 43 | 44 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send_default_pii 45 | 'send_default_pii' => true, 46 | 47 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore_exceptions 48 | // 'ignore_exceptions' => [], 49 | 50 | // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore_transactions 51 | 'ignore_transactions' => [ 52 | // Ignore Laravel's default health URL 53 | '/up', 54 | ], 55 | 56 | // Breadcrumb specific configuration 57 | 'breadcrumbs' => [ 58 | // Capture Laravel logs as breadcrumbs 59 | 'logs' => true, 60 | 61 | // Capture Laravel cache events (hits, writes etc.) as breadcrumbs 62 | 'cache' => true, 63 | 64 | // Capture Livewire components like routes as breadcrumbs 65 | 'livewire' => true, 66 | 67 | // Capture SQL queries as breadcrumbs 68 | 'sql_queries' => true, 69 | 70 | // Capture SQL query bindings (parameters) in SQL query breadcrumbs 71 | 'sql_bindings' => true, // overrode default 72 | 73 | // Capture queue job information as breadcrumbs 74 | 'queue_info' => true, 75 | 76 | // Capture command information as breadcrumbs 77 | 'command_info' => true, 78 | 79 | // Capture HTTP client request information as breadcrumbs 80 | 'http_client_requests' => true, 81 | 82 | // Capture send notifications as breadcrumbs 83 | 'notifications' => true, 84 | ], 85 | 86 | // Performance monitoring specific configuration 87 | 'tracing' => [ 88 | // Trace queue jobs as their own transactions (this enables tracing for queue jobs) 89 | 'queue_job_transactions' => true, 90 | 91 | // Capture queue jobs as spans when executed on the sync driver 92 | 'queue_jobs' => true, 93 | 94 | // Capture SQL queries as spans 95 | 'sql_queries' => true, 96 | 97 | // Capture SQL query bindings (parameters) in SQL query spans 98 | 'sql_bindings' => false, 99 | 100 | // Capture where the SQL query originated from on the SQL query spans 101 | 'sql_origin' => true, 102 | 103 | // Define a threshold in milliseconds for SQL queries to resolve their origin 104 | 'sql_origin_threshold_ms' => env('SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS', 100), 105 | 106 | // Capture views rendered as spans 107 | 'views' => true, 108 | 109 | // Capture Livewire components as spans 110 | 'livewire' => true, 111 | 112 | // Capture HTTP client requests as spans 113 | 'http_client_requests' => true, 114 | 115 | // Capture Laravel cache events (hits, writes etc.) as spans 116 | 'cache' => true, 117 | 118 | // Capture Redis operations as spans (this enables Redis events in Laravel) 119 | 'redis_commands' => false, 120 | 121 | // Capture where the Redis command originated from on the Redis command spans 122 | 'redis_origin' => true, 123 | 124 | // Capture send notifications as spans 125 | 'notifications' => true, 126 | 127 | // Enable tracing for requests without a matching route (404's) 128 | 'missing_routes' => true, // overrode default 129 | 130 | // Configures if the performance trace should continue after the response has been sent to the user until the application terminates 131 | // This is required to capture any spans that are created after the response has been sent like queue jobs dispatched using `dispatch(...)->afterResponse()` for example 132 | 'continue_after_response' => true, 133 | 134 | // Enable the tracing integrations supplied by Sentry (recommended) 135 | 'default_integrations' => true, 136 | ], 137 | ]; 138 | --------------------------------------------------------------------------------