├── .editorconfig ├── .env.example ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── docker-commit.yml │ ├── docker-latest-tag.yaml │ └── docker-release-tag.yaml ├── .gitignore ├── .helm ├── deploy.sh ├── extra │ ├── nginx-values.yaml │ ├── prometheus-adapter-values.yaml │ └── prometheus-values.yaml ├── laravel-octane-values.yaml ├── laravel-values.yaml ├── laravel-worker-values.yaml └── secret.yaml ├── .styleci.yml ├── Dockerfile.fpm ├── Dockerfile.octane ├── Dockerfile.worker ├── README.md ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Controller.php │ │ └── HealthController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Models │ └── User.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── octane.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ └── 2019_08_19_000000_create_failed_jobs_table.php └── seeders │ └── DatabaseSeeder.php ├── deploy.sh ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── robots.txt └── web.config ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_LEVEL=debug 9 | 10 | DB_CONNECTION=mysql 11 | DB_HOST=127.0.0.1 12 | DB_PORT=3306 13 | DB_DATABASE=laravel 14 | DB_USERNAME=root 15 | DB_PASSWORD= 16 | 17 | BROADCAST_DRIVER=log 18 | CACHE_DRIVER=file 19 | QUEUE_CONNECTION=sync 20 | SESSION_DRIVER=file 21 | SESSION_LIFETIME=120 22 | 23 | MEMCACHED_HOST=127.0.0.1 24 | 25 | REDIS_HOST=127.0.0.1 26 | REDIS_PASSWORD=null 27 | REDIS_PORT=6379 28 | 29 | MAIL_MAILER=smtp 30 | MAIL_HOST=mailhog 31 | MAIL_PORT=1025 32 | MAIL_USERNAME=null 33 | MAIL_PASSWORD=null 34 | MAIL_ENCRYPTION=null 35 | MAIL_FROM_ADDRESS=null 36 | MAIL_FROM_NAME="${APP_NAME}" 37 | 38 | AWS_ACCESS_KEY_ID= 39 | AWS_SECRET_ACCESS_KEY= 40 | AWS_DEFAULT_REGION=us-east-1 41 | AWS_BUCKET= 42 | 43 | PUSHER_APP_ID= 44 | PUSHER_APP_KEY= 45 | PUSHER_APP_SECRET= 46 | PUSHER_APP_CLUSTER=mt1 47 | 48 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 49 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 50 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | registries: 3 | quay: 4 | type: docker-registry 5 | url: quay.io 6 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 7 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 8 | updates: 9 | - package-ecosystem: github-actions 10 | directory: "/" 11 | schedule: 12 | interval: weekly 13 | open-pull-requests-limit: 10 14 | - package-ecosystem: docker 15 | directory: "/" 16 | registries: 17 | - quay 18 | schedule: 19 | interval: weekly 20 | open-pull-requests-limit: 10 21 | -------------------------------------------------------------------------------- /.github/workflows/docker-commit.yml: -------------------------------------------------------------------------------- 1 | name: Docker Commit 2 | 3 | on: 4 | push: 5 | branches: 6 | - "*" 7 | pull_request: 8 | branches: 9 | - "*" 10 | 11 | jobs: 12 | fpm_push: 13 | if: "!contains(github.event.head_commit.message, 'skip ci')" 14 | 15 | runs-on: ubuntu-latest 16 | 17 | name: Tag Commit (PHP-FPM) 18 | 19 | steps: 20 | - uses: actions/checkout@v3 21 | 22 | - name: Setup PHP 23 | uses: shivammathur/setup-php@v2 24 | with: 25 | php-version: 8.0 26 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 27 | coverage: pcov 28 | 29 | - uses: actions/cache@v3.0.5 30 | name: Cache Composer dependencies 31 | with: 32 | path: ~/.composer/cache/files 33 | key: composer-${{ hashFiles('composer.json') }} 34 | 35 | - name: Set up QEMU 36 | uses: docker/setup-qemu-action@v2 37 | 38 | - name: Set up Docker Buildx 39 | uses: docker/setup-buildx-action@v2 40 | 41 | - name: Login to Quay 42 | uses: docker/login-action@v2 43 | with: 44 | registry: quay.io 45 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 46 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 47 | 48 | - name: Install dependencies 49 | run: | 50 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 51 | 52 | - name: Build and push 53 | id: docker 54 | uses: docker/build-push-action@v3 55 | with: 56 | push: true 57 | context: . 58 | tags: quay.io/renokico/laravel-helm-demo:${{ github.sha }} 59 | file: Dockerfile.fpm 60 | 61 | octane_push: 62 | if: "!contains(github.event.head_commit.message, 'skip ci')" 63 | 64 | runs-on: ubuntu-latest 65 | 66 | name: Tag Commit (Octane) 67 | 68 | steps: 69 | - uses: actions/checkout@v3 70 | 71 | - name: Setup PHP 72 | uses: shivammathur/setup-php@v2 73 | with: 74 | php-version: 8.0 75 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 76 | coverage: pcov 77 | 78 | - uses: actions/cache@v3.0.5 79 | name: Cache Composer dependencies 80 | with: 81 | path: ~/.composer/cache/files 82 | key: composer-${{ hashFiles('composer.json') }} 83 | 84 | - name: Set up QEMU 85 | uses: docker/setup-qemu-action@v2 86 | 87 | - name: Set up Docker Buildx 88 | uses: docker/setup-buildx-action@v2 89 | 90 | - name: Login to Quay 91 | uses: docker/login-action@v2 92 | with: 93 | registry: quay.io 94 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 95 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 96 | 97 | - name: Install dependencies 98 | run: | 99 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 100 | 101 | - name: Build and push 102 | id: docker 103 | uses: docker/build-push-action@v3 104 | with: 105 | push: true 106 | context: . 107 | tags: quay.io/renokico/laravel-helm-demo:octane-${{ github.sha }} 108 | file: Dockerfile.octane 109 | 110 | worker_push: 111 | if: "!contains(github.event.head_commit.message, 'skip ci')" 112 | 113 | runs-on: ubuntu-latest 114 | 115 | name: Tag Commit (Worker) 116 | 117 | steps: 118 | - uses: actions/checkout@v3 119 | 120 | - name: Setup PHP 121 | uses: shivammathur/setup-php@v2 122 | with: 123 | php-version: 8.0 124 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 125 | coverage: pcov 126 | 127 | - uses: actions/cache@v3.0.5 128 | name: Cache Composer dependencies 129 | with: 130 | path: ~/.composer/cache/files 131 | key: composer-${{ hashFiles('composer.json') }} 132 | 133 | - name: Set up QEMU 134 | uses: docker/setup-qemu-action@v2 135 | 136 | - name: Set up Docker Buildx 137 | uses: docker/setup-buildx-action@v2 138 | 139 | - name: Login to Quay 140 | uses: docker/login-action@v2 141 | with: 142 | registry: quay.io 143 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 144 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 145 | 146 | - name: Install dependencies 147 | run: | 148 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 149 | 150 | - name: Build and push 151 | id: docker 152 | uses: docker/build-push-action@v3 153 | with: 154 | push: true 155 | context: . 156 | tags: quay.io/renokico/laravel-helm-demo:worker-${{ github.sha }} 157 | file: Dockerfile.worker 158 | -------------------------------------------------------------------------------- /.github/workflows/docker-latest-tag.yaml: -------------------------------------------------------------------------------- 1 | name: Docker Latest 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | push_fpm: 10 | if: "!contains(github.event.head_commit.message, 'skip ci')" 11 | 12 | runs-on: ubuntu-latest 13 | 14 | name: Tag Latest (PHP-FPM) 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - name: Setup PHP 20 | uses: shivammathur/setup-php@v2 21 | with: 22 | php-version: 8.0 23 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 24 | coverage: pcov 25 | 26 | - uses: actions/cache@v3.0.5 27 | name: Cache Composer dependencies 28 | with: 29 | path: ~/.composer/cache/files 30 | key: composer-${{ hashFiles('composer.json') }} 31 | 32 | - name: Set up QEMU 33 | uses: docker/setup-qemu-action@v2 34 | 35 | - name: Set up Docker Buildx 36 | uses: docker/setup-buildx-action@v2 37 | 38 | - name: Login to Quay 39 | uses: docker/login-action@v2 40 | with: 41 | registry: quay.io 42 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 43 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 44 | 45 | - name: Install dependencies 46 | run: | 47 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 48 | 49 | - name: Build and push 50 | id: docker 51 | uses: docker/build-push-action@v3 52 | with: 53 | push: true 54 | context: . 55 | tags: quay.io/renokico/laravel-helm-demo:latest 56 | file: Dockerfile.fpm 57 | 58 | push_octane: 59 | if: "!contains(github.event.head_commit.message, 'skip ci')" 60 | 61 | runs-on: ubuntu-latest 62 | 63 | name: Tag Latest (Octane) 64 | 65 | steps: 66 | - uses: actions/checkout@v3 67 | 68 | - name: Setup PHP 69 | uses: shivammathur/setup-php@v2 70 | with: 71 | php-version: 8.0 72 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 73 | coverage: pcov 74 | 75 | - uses: actions/cache@v3.0.5 76 | name: Cache Composer dependencies 77 | with: 78 | path: ~/.composer/cache/files 79 | key: composer-${{ hashFiles('composer.json') }} 80 | 81 | - name: Set up QEMU 82 | uses: docker/setup-qemu-action@v2 83 | 84 | - name: Set up Docker Buildx 85 | uses: docker/setup-buildx-action@v2 86 | 87 | - name: Login to Quay 88 | uses: docker/login-action@v2 89 | with: 90 | registry: quay.io 91 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 92 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 93 | 94 | - name: Install dependencies 95 | run: | 96 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 97 | 98 | - name: Build and push 99 | id: docker 100 | uses: docker/build-push-action@v3 101 | with: 102 | push: true 103 | context: . 104 | tags: quay.io/renokico/laravel-helm-demo:octane-latest 105 | file: Dockerfile.octane 106 | 107 | push_worker: 108 | if: "!contains(github.event.head_commit.message, 'skip ci')" 109 | 110 | runs-on: ubuntu-latest 111 | 112 | name: Tag Latest (Worker) 113 | 114 | steps: 115 | - uses: actions/checkout@v3 116 | 117 | - name: Setup PHP 118 | uses: shivammathur/setup-php@v2 119 | with: 120 | php-version: 8.0 121 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 122 | coverage: pcov 123 | 124 | - uses: actions/cache@v3.0.5 125 | name: Cache Composer dependencies 126 | with: 127 | path: ~/.composer/cache/files 128 | key: composer-${{ hashFiles('composer.json') }} 129 | 130 | - name: Set up QEMU 131 | uses: docker/setup-qemu-action@v2 132 | 133 | - name: Set up Docker Buildx 134 | uses: docker/setup-buildx-action@v2 135 | 136 | - name: Login to Quay 137 | uses: docker/login-action@v2 138 | with: 139 | registry: quay.io 140 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 141 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 142 | 143 | - name: Install dependencies 144 | run: | 145 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 146 | 147 | - name: Build and push 148 | id: docker 149 | uses: docker/build-push-action@v3 150 | with: 151 | push: true 152 | context: . 153 | tags: quay.io/renokico/laravel-helm-demo:worker-latest 154 | file: Dockerfile.worker 155 | -------------------------------------------------------------------------------- /.github/workflows/docker-release-tag.yaml: -------------------------------------------------------------------------------- 1 | name: Docker Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | jobs: 9 | push_fpm: 10 | if: "!contains(github.event.head_commit.message, 'skip ci')" 11 | 12 | runs-on: ubuntu-latest 13 | 14 | name: Tag Release (PHP-FPM) 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - name: Setup PHP 20 | uses: shivammathur/setup-php@v2 21 | with: 22 | php-version: 8.0 23 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 24 | coverage: pcov 25 | 26 | - uses: actions/cache@v3.0.5 27 | name: Cache Composer dependencies 28 | with: 29 | path: ~/.composer/cache/files 30 | key: composer-${{ hashFiles('composer.json') }} 31 | 32 | - name: Docker meta 33 | id: docker_meta 34 | uses: docker/metadata-action@v4.0.1 35 | with: 36 | images: quay.io/renokico/laravel-helm-demo 37 | tags: | 38 | type=semver,pattern={{version}} 39 | type=semver,pattern={{major}}.{{minor}} 40 | 41 | - name: Set up QEMU 42 | uses: docker/setup-qemu-action@v2 43 | 44 | - name: Set up Docker Buildx 45 | uses: docker/setup-buildx-action@v2 46 | 47 | - name: Login to Quay 48 | uses: docker/login-action@v2 49 | with: 50 | registry: quay.io 51 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 52 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 53 | 54 | - name: Install dependencies 55 | run: | 56 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 57 | 58 | - name: Build and Push 59 | id: docker 60 | uses: docker/build-push-action@v3 61 | with: 62 | push: true 63 | context: . 64 | tags: ${{ steps.docker_meta.outputs.tags }} 65 | labels: ${{ steps.docker_meta.outputs.labels }} 66 | file: Dockerfile.fpm 67 | 68 | push_octane: 69 | if: "!contains(github.event.head_commit.message, 'skip ci')" 70 | 71 | runs-on: ubuntu-latest 72 | 73 | name: Tag Release (Octane) 74 | 75 | steps: 76 | - uses: actions/checkout@v3 77 | 78 | - name: Setup PHP 79 | uses: shivammathur/setup-php@v2 80 | with: 81 | php-version: 8.0 82 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 83 | coverage: pcov 84 | 85 | - uses: actions/cache@v3.0.5 86 | name: Cache Composer dependencies 87 | with: 88 | path: ~/.composer/cache/files 89 | key: composer-${{ hashFiles('composer.json') }} 90 | 91 | - name: Docker meta 92 | id: docker_meta 93 | uses: docker/metadata-action@v4.0.1 94 | with: 95 | images: quay.io/renokico/laravel-helm-demo 96 | tags: | 97 | type=semver,pattern=octane-{{version}} 98 | type=semver,pattern=octane-{{major}}.{{minor}} 99 | 100 | - name: Set up QEMU 101 | uses: docker/setup-qemu-action@v2 102 | 103 | - name: Set up Docker Buildx 104 | uses: docker/setup-buildx-action@v2 105 | 106 | - name: Login to Quay 107 | uses: docker/login-action@v2 108 | with: 109 | registry: quay.io 110 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 111 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 112 | 113 | - name: Install dependencies 114 | run: | 115 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 116 | 117 | - name: Build and Push 118 | id: docker 119 | uses: docker/build-push-action@v3 120 | with: 121 | push: true 122 | context: . 123 | tags: ${{ steps.docker_meta.outputs.tags }} 124 | labels: ${{ steps.docker_meta.outputs.labels }} 125 | file: Dockerfile.octane 126 | 127 | push_worker: 128 | if: "!contains(github.event.head_commit.message, 'skip ci')" 129 | 130 | runs-on: ubuntu-latest 131 | 132 | name: Tag Release (Worker) 133 | 134 | steps: 135 | - uses: actions/checkout@v3 136 | 137 | - name: Setup PHP 138 | uses: shivammathur/setup-php@v2 139 | with: 140 | php-version: 8.0 141 | extensions: dom, curl, intl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite 142 | coverage: pcov 143 | 144 | - uses: actions/cache@v3.0.5 145 | name: Cache Composer dependencies 146 | with: 147 | path: ~/.composer/cache/files 148 | key: composer-${{ hashFiles('composer.json') }} 149 | 150 | - name: Docker meta 151 | id: docker_meta 152 | uses: docker/metadata-action@v4.0.1 153 | with: 154 | images: quay.io/renokico/laravel-helm-demo 155 | tags: | 156 | type=semver,pattern=worker-{{version}} 157 | type=semver,pattern=worker-{{major}}.{{minor}} 158 | 159 | - name: Set up QEMU 160 | uses: docker/setup-qemu-action@v2 161 | 162 | - name: Set up Docker Buildx 163 | uses: docker/setup-buildx-action@v2 164 | 165 | - name: Login to Quay 166 | uses: docker/login-action@v2 167 | with: 168 | registry: quay.io 169 | username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} 170 | password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} 171 | 172 | - name: Install dependencies 173 | run: | 174 | composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev 175 | 176 | - name: Build and Push 177 | id: docker 178 | uses: docker/build-push-action@v3 179 | with: 180 | push: true 181 | context: . 182 | tags: ${{ steps.docker_meta.outputs.tags }} 183 | labels: ${{ steps.docker_meta.outputs.labels }} 184 | file: Dockerfile.worker 185 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.backup 8 | .phpunit.result.cache 9 | docker-compose.override.yml 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | yarn-error.log 14 | -------------------------------------------------------------------------------- /.helm/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # NGINX INGRESS CONTROLLER 4 | # Optional: deploy NGINX Ingress Controller into your cluster 5 | # to expose the ingress outside the cluster. 6 | 7 | # helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx 8 | # helm repo update 9 | 10 | # helm upgrade nginx \ 11 | # --version=3.26.0 \ 12 | # -f extra/nginx-values.yaml \ 13 | # --install \ 14 | # ingress-nginx/ingress-nginx 15 | 16 | # PROMETHEUS 17 | # Optional: deploy Prometheus & Prometheus Adapter to scrape 18 | # the pod metrics (if PHP-FPM and NGINX exporters are enabled) 19 | # to automatically scale the containers based on the pm.max_children value. 20 | 21 | # helm repo add prometheus-community https://prometheus-community.github.io/helm-charts 22 | # helm repo add kube-state-metrics https://kubernetes.github.io/kube-state-metrics 23 | # helm repo update 24 | 25 | # helm upgrade prometheus \ 26 | # --version=13.6.0 \ 27 | # -f extra/prometheus-values.yaml \ 28 | # --install \ 29 | # prometheus-community/prometheus 30 | 31 | # helm upgrade prometheus-adapter \ 32 | # --version=2.12.1 \ 33 | # -f extra/prometheus-adapter-values.yaml \ 34 | # --install \ 35 | # prometheus-community/prometheus-adapter 36 | 37 | # INSTALL LARAVEL APPLICATION 38 | # Deploy the Secret that will contain the .env file. 39 | kubectl apply -f secret.yaml 40 | 41 | helm repo add renoki-co https://helm.renoki.org 42 | helm repo update 43 | 44 | # Deploy the Laravel app. 45 | # helm upgrade laravel \ 46 | # --version=0.9.0 \ 47 | # -f laravel-values.yaml \ 48 | # --install \ 49 | # renoki-co/laravel 50 | 51 | # Alternative: Deploy the Laravel app with Octane. 52 | helm upgrade laravel-octane \ 53 | --version=0.3.0 \ 54 | -f laravel-octane-values.yaml \ 55 | --install \ 56 | renoki-co/laravel-octane 57 | 58 | # Deploy (an example) worker for Laravel Queues. 59 | helm upgrade laravel-worker \ 60 | --version=0.3.0 \ 61 | -f laravel-worker-values.yaml \ 62 | --install \ 63 | renoki-co/laravel-worker 64 | -------------------------------------------------------------------------------- /.helm/extra/prometheus-adapter-values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for k8s-prometheus-adapter.. 2 | affinity: {} 3 | 4 | image: 5 | repository: directxman12/k8s-prometheus-adapter-amd64 6 | tag: v0.8.3 7 | pullPolicy: IfNotPresent 8 | 9 | logLevel: 4 10 | 11 | metricsRelistInterval: 1m 12 | 13 | listenPort: 6443 14 | 15 | nodeSelector: {} 16 | 17 | priorityClassName: "" 18 | 19 | # Url to access prometheus 20 | prometheus: 21 | # Value is templated 22 | url: http://prometheus-server.default.svc.cluster.local 23 | port: 9090 24 | path: "" 25 | 26 | replicas: 1 27 | 28 | rbac: 29 | # Specifies whether RBAC resources should be created 30 | create: true 31 | 32 | psp: 33 | # Specifies whether PSP resources should be created 34 | create: false 35 | 36 | serviceAccount: 37 | # Specifies whether a service account should be created 38 | create: true 39 | # The name of the service account to use. 40 | # If not set and create is true, a name is generated using the fullname template 41 | name: 42 | # Custom DNS configuration to be added to prometheus-adapter pods 43 | dnsConfig: {} 44 | # nameservers: 45 | # - 1.2.3.4 46 | # searches: 47 | # - ns1.svc.cluster-domain.example 48 | # - my.dns.search.suffix 49 | # options: 50 | # - name: ndots 51 | # value: "2" 52 | # - name: edns0 53 | resources: {} 54 | # requests: 55 | # cpu: 100m 56 | # memory: 128Mi 57 | # limits: 58 | # cpu: 100m 59 | # memory: 128Mi 60 | 61 | rules: 62 | default: true 63 | custom: 64 | - seriesQuery: 'phpfpm_total_processes{namespace!="", pod_name!=""}' 65 | resources: 66 | overrides: 67 | namespace: 68 | resource: "namespace" 69 | pod_name: 70 | resource: "pod" 71 | name: 72 | matches: "phpfpm_total_processes" 73 | as: "phpfpm_process_utilization" 74 | metricsQuery: 'max((100 / phpfpm_total_processes) * phpfpm_active_processes) by (<<.GroupBy>>)' 75 | # - seriesQuery: '{__name__=~"^some_metric_count$"}' 76 | # resources: 77 | # template: <<.Resource>> 78 | # name: 79 | # matches: "" 80 | # as: "my_custom_metric" 81 | # metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) 82 | # Mounts a configMap with pre-generated rules for use. Overrides the 83 | # default, custom, external and resource entries 84 | existing: 85 | external: [] 86 | # - seriesQuery: '{__name__=~"^some_metric_count$"}' 87 | # resources: 88 | # template: <<.Resource>> 89 | # name: 90 | # matches: "" 91 | # as: "my_external_metric" 92 | # metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) 93 | resource: {} 94 | # cpu: 95 | # containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>) 96 | # nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>) 97 | # resources: 98 | # overrides: 99 | # instance: 100 | # resource: node 101 | # namespace: 102 | # resource: namespace 103 | # pod: 104 | # resource: pod 105 | # containerLabel: container 106 | # memory: 107 | # containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>) 108 | # nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>) 109 | # resources: 110 | # overrides: 111 | # instance: 112 | # resource: node 113 | # namespace: 114 | # resource: namespace 115 | # pod: 116 | # resource: pod 117 | # containerLabel: container 118 | # window: 3m 119 | 120 | service: 121 | annotations: {} 122 | port: 443 123 | type: ClusterIP 124 | 125 | tls: 126 | enable: false 127 | ca: |- 128 | # Public CA file that signed the APIService 129 | key: |- 130 | # Private key of the APIService 131 | certificate: |- 132 | # Public key of the APIService 133 | 134 | # Any extra arguments 135 | extraArguments: [] 136 | # - --tls-private-key-file=/etc/tls/tls.key 137 | # - --tls-cert-file=/etc/tls/tls.crt 138 | 139 | # Any extra volumes 140 | extraVolumes: [] 141 | # - name: example-name 142 | # hostPath: 143 | # path: /path/on/host 144 | # type: DirectoryOrCreate 145 | # - name: ssl-certs 146 | # hostPath: 147 | # path: /etc/ssl/certs/ca-bundle.crt 148 | # type: File 149 | 150 | # Any extra volume mounts 151 | extraVolumeMounts: [] 152 | # - name: example-name 153 | # mountPath: /path/in/container 154 | # - name: ssl-certs 155 | # mountPath: /etc/ssl/certs/ca-certificates.crt 156 | # readOnly: true 157 | 158 | tolerations: [] 159 | 160 | # Labels added to the pod 161 | podLabels: {} 162 | 163 | # Annotations added to the pod 164 | podAnnotations: {} 165 | 166 | hostNetwork: 167 | # Specifies if prometheus-adapter should be started in hostNetwork mode. 168 | # 169 | # You would require this enabled if you use alternate overlay networking for pods and 170 | # API server unable to communicate with metrics-server. As an example, this is required 171 | # if you use Weave network on EKS. See also dnsPolicy 172 | enabled: false 173 | 174 | # When hostNetwork is enabled, you probably want to set this to ClusterFirstWithHostNet 175 | # dnsPolicy: ClusterFirstWithHostNet 176 | 177 | podDisruptionBudget: 178 | # Specifies if PodDisruptionBudget should be enabled 179 | # When enabled, minAvailable or maxUnavailable should also be defined. 180 | enabled: false 181 | minAvailable: 182 | maxUnavailable: 1 183 | 184 | certManager: 185 | enabled: false 186 | caCertDuration: 43800h 187 | certDuration: 8760h 188 | -------------------------------------------------------------------------------- /.helm/laravel-octane-values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for laravel-helm. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | nameOverride: "" 8 | fullnameOverride: "" 9 | imagePullSecrets: [] 10 | 11 | # Configure Octane-based Laravel container. 12 | app: 13 | image: 14 | repository: quay.io/renokico/laravel-helm-demo 15 | pullPolicy: Always 16 | tag: "octane-0.6.0" 17 | 18 | command: 19 | - php 20 | - -d 21 | - variables_order=EGPCS 22 | - artisan 23 | - octane:start 24 | - --server=swoole 25 | - --host=0.0.0.0 26 | - --port=80 27 | 28 | # Specify the Secret name to pull the .env file from. 29 | # If not specified, it defaults to "{release name}-env". It should 30 | # be a secret that contains an ".env" data key with the full 31 | # .env file that will be copied during pod creation. 32 | # The secret should be created by you before running the app. 33 | envSecretName: "laravel-env" 34 | 35 | # We usually recommend not to specify default resources and to leave this as a conscious 36 | # choice for the user. This also increases chances charts run on environments with little 37 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 38 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 39 | resources: 40 | limits: 41 | cpu: 250m 42 | memory: 256Mi 43 | requests: 44 | cpu: 100m 45 | memory: 128Mi 46 | 47 | # Extra environment variables for the app container. 48 | extraEnv: 49 | - name: POD_NAME 50 | valueFrom: 51 | fieldRef: 52 | fieldPath: metadata.name 53 | 54 | # Extra volumes to mount on the container. 55 | extraVolumeMounts: [] 56 | # - name: some-folder 57 | # mountPath: /some/path 58 | 59 | # Configure the TCP healthcheck for the Octane process. 60 | # If enabled, Kubernetes will periodically check the Octane Server 61 | # process to be alive and to serve HTTP requests. 62 | healthcheck: 63 | enabled: true 64 | period: 5 65 | path: /health 66 | 67 | serviceAccount: 68 | # Specifies whether a service account should be created 69 | create: true 70 | # Annotations to add to the service account 71 | annotations: {} 72 | # The name of the service account to use. 73 | # If not set and create is true, a name is generated using the fullname template 74 | name: "" 75 | 76 | podAnnotations: {} 77 | 78 | podSecurityContext: {} 79 | # fsGroup: 2000 80 | 81 | securityContext: {} 82 | # capabilities: 83 | # drop: 84 | # - ALL 85 | # readOnlyRootFilesystem: true 86 | # runAsNonRoot: true 87 | # runAsUser: 1000 88 | 89 | service: 90 | type: ClusterIP 91 | port: 80 92 | 93 | annotations: {} 94 | # Set annotations for the service. 95 | 96 | ingress: 97 | enabled: true 98 | annotations: 99 | kubernetes.io/ingress.class: nginx 100 | # kubernetes.io/ingress.class: nginx 101 | # kubernetes.io/tls-acme: "true" 102 | hosts: 103 | - host: test-octane.laravel.com 104 | paths: 105 | - / 106 | tls: [] 107 | # - secretName: chart-example-tls 108 | # hosts: 109 | # - chart-example.local 110 | 111 | autoscaling: 112 | enabled: true 113 | minReplicas: 1 114 | maxReplicas: 10 115 | targetCPUUtilizationPercentage: 80 116 | # targetMemoryUtilizationPercentage: 80 117 | 118 | behavior: {} 119 | # Set the behavior for the autoscaler. 120 | # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior 121 | 122 | # Custom Metrics will be appended to the default CPU/Memory resources (if they're enabled). 123 | customMetrics: [] 124 | # - type: Pods 125 | # pods: 126 | # metric: 127 | # name: cpu 128 | # target: 129 | # type: AverageValue 130 | # averageValue: "50" 131 | 132 | pdb: 133 | enabled: true 134 | minAvailable: 1 135 | # maxUnavailable: 25% 136 | 137 | nodeSelector: {} 138 | 139 | tolerations: [] 140 | 141 | affinity: {} 142 | 143 | # Extra volumes to attach to the deployment. 144 | extraVolumes: [] 145 | # - name: some-folder 146 | # emptyDir: {} 147 | 148 | # Extra containers to run in the deployment. 149 | extraContainers: [] 150 | 151 | # Extra init containers to run in the deployment. 152 | extraInitContainers: [] 153 | 154 | # Configure the php.ini used for the PHP process. 155 | # This will overwrite the default ones that exists in the container. 156 | phpIni: 157 | # Specify the Config name to pull the php.ini configuration from. 158 | # If not specified, it defaults to "{release name}-php-ini-config". 159 | # This will be automatically be created for you if you do not specify it. 160 | # configName: "" 161 | 162 | # If no configName is specified, this will be the config 163 | # applied to the app container. 164 | content: | 165 | ; Determines if Zend OPCache is enabled 166 | opcache.enable=1 167 | 168 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 169 | opcache.enable_cli=1 170 | 171 | ; The OPcache shared memory storage size. 172 | opcache.memory_consumption=128 173 | 174 | ; The amount of memory for interned strings in Mbytes. 175 | opcache.interned_strings_buffer=128 176 | 177 | ; The maximum number of keys (scripts) in the OPcache hash table. 178 | ; Only numbers between 200 and 1000000 are allowed. 179 | opcache.max_accelerated_files=1000000 180 | 181 | ; maximum memory allocated to store the results 182 | realpath_cache_size=8192K 183 | 184 | ; save the results for 10 minutes (600 seconds) 185 | realpath_cache_ttl=600 186 | 187 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 188 | opcache.max_wasted_percentage=5 189 | 190 | ; When this directive is enabled, the OPcache appends the current working 191 | ; directory to the script key, thus eliminating possible collisions between 192 | ; files with the same name (basename). Disabling the directive improves 193 | ; performance, but may break existing applications. 194 | ;opcache.use_cwd=1 195 | 196 | ; When disabled, you must reset the OPcache manually or restart the 197 | ; webserver for changes to the filesystem to take effect. 198 | opcache.validate_timestamps=0 199 | 200 | ; How often (in seconds) to check file timestamps for changes to the shared 201 | ; memory storage allocation. ("1" means validate once per second, but only 202 | ; once per request. "0" means always validate) 203 | opcache.revalidate_freq=0 204 | 205 | ; Enables or disables file search in include_path optimization 206 | ;opcache.revalidate_path=0 207 | 208 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 209 | ; size of the optimized code. 210 | ;opcache.save_comments=1 211 | 212 | ; If enabled, a fast shutdown sequence is used for the accelerated code 213 | ; Depending on the used Memory Manager this may cause some incompatibilities. 214 | opcache.fast_shutdown=1 215 | 216 | ; Allow file existence override (file_exists, etc.) performance feature. 217 | ;opcache.enable_file_override=0 218 | 219 | ; A bitmask, where each bit enables or disables the appropriate OPcache 220 | ; passes 221 | ;opcache.optimization_level=0xffffffff 222 | 223 | ;opcache.inherited_hack=1 224 | ;opcache.dups_fix=0 225 | 226 | ; The location of the OPcache blacklist file (wildcards allowed). 227 | ; Each OPcache blacklist file is a text file that holds the names of files 228 | ; that should not be accelerated. 229 | opcache.blacklist_filename=/etc/php-*/opcache*.blacklist 230 | 231 | ; Allows exclusion of large files from being cached. By default all files 232 | ; are cached. 233 | ;opcache.max_file_size=0 234 | 235 | ; Check the cache checksum each N requests. 236 | ; The default value of "0" means that the checks are disabled. 237 | ;opcache.consistency_checks=0 238 | 239 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 240 | ; is not being accessed. 241 | ;opcache.force_restart_timeout=180 242 | 243 | ; OPcache error_log file name. Empty string assumes "stderr". 244 | ;opcache.error_log= 245 | 246 | ; All OPcache errors go to the Web server log. 247 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 248 | ; You can also enable warnings (level 2), info messages (level 3) or 249 | ; debug messages (level 4). 250 | ;opcache.log_verbosity_level=1 251 | 252 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 253 | ;opcache.preferred_memory_model= 254 | 255 | ; Protect the shared memory from unexpected writing during script execution. 256 | ; Useful for internal debugging only. 257 | ;opcache.protect_memory=0 258 | 259 | ; Allows calling OPcache API functions only from PHP scripts which path is 260 | ; started from specified string. The default "" means no restriction 261 | ;opcache.restrict_api= 262 | 263 | ; Enables and sets the second level cache directory. 264 | ; It should improve performance when SHM memory is full, at server restart or 265 | ; SHM reset. The default "" disables file based caching. 266 | ; RPM note : file cache directory must be owned by process owner 267 | ; for mod_php, see /etc/httpd/conf.d/php.conf 268 | ; for php-fpm, see /etc/php-fpm.d/*conf 269 | ;opcache.file_cache= 270 | 271 | ; Enables or disables opcode caching in shared memory. 272 | ;opcache.file_cache_only=0 273 | 274 | ; Enables or disables checksum validation when script loaded from file cache. 275 | ;opcache.file_cache_consistency_checks=1 276 | 277 | ; Implies opcache.file_cache_only=1 for a certain process that failed to 278 | ; reattach to the shared memory (for Windows only). Explicitly enabled file 279 | ; cache is required. 280 | ;opcache.file_cache_fallback=1 281 | 282 | ; Validate cached file permissions. 283 | ; Leads OPcache to check file readability on each access to cached file. 284 | ; This directive should be enabled in shared hosting environment, when few 285 | ; users (PHP-FPM pools) reuse the common OPcache shared memory. 286 | ;opcache.validate_permission=0 287 | 288 | ; Prevent name collisions in chroot'ed environment. 289 | ; This directive prevents file name collisions in different "chroot" 290 | ; environments. It should be enabled for sites that may serve requests in 291 | ; different "chroot" environments. 292 | ;opcache.validate_root=0 293 | 294 | ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. 295 | ; This should improve performance, but requires appropriate OS configuration. 296 | opcache.huge_code_pages=1 297 | 298 | ; Maximum amount of memory a script may consume 299 | ; http://php.net/memory-limit 300 | memory_limit = 128M 301 | 302 | ; Maximum execution time of each script, in seconds 303 | ; http://php.net/max-execution-time 304 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 305 | max_execution_time = 30 306 | 307 | ;;;;;;;;;;;;;;;; 308 | ; File Uploads ; 309 | ;;;;;;;;;;;;;;;; 310 | 311 | ; Whether to allow HTTP file uploads. 312 | ; http://php.net/file-uploads 313 | file_uploads = On 314 | 315 | ; Temporary directory for HTTP uploaded files (will use system default if not 316 | ; specified). 317 | ; http://php.net/upload-tmp-dir 318 | ;upload_tmp_dir = 319 | 320 | ; Maximum allowed size for uploaded files. 321 | ; http://php.net/upload-max-filesize 322 | upload_max_filesize = 2M 323 | 324 | ; Maximum number of files that can be uploaded via a single request 325 | max_file_uploads = 20 326 | 327 | ;;;;;;;;;;;;;;;;;; 328 | ; Fopen wrappers ; 329 | ;;;;;;;;;;;;;;;;;; 330 | 331 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 332 | ; http://php.net/allow-url-fopen 333 | allow_url_fopen = On 334 | 335 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 336 | ; http://php.net/allow-url-include 337 | allow_url_include = Off 338 | 339 | [Session] 340 | ; Handler used to store/retrieve data. 341 | ; http://php.net/session.save-handler 342 | session.save_handler = files 343 | 344 | ; Argument passed to save_handler. In the case of files, this is the path 345 | ; where data files are stored. Note: Windows users have to change this 346 | ; variable in order to use PHP's session functions. 347 | ; 348 | ; The path can be defined as: 349 | ; 350 | ; session.save_path = "N;/path" 351 | ; 352 | ; where N is an integer. Instead of storing all the session files in 353 | ; /path, what this will do is use subdirectories N-levels deep, and 354 | ; store the session data in those directories. This is useful if 355 | ; your OS has problems with many files in one directory, and is 356 | ; a more efficient layout for servers that handle many sessions. 357 | ; 358 | ; NOTE 1: PHP will not create this directory structure automatically. 359 | ; You can use the script in the ext/session dir for that purpose. 360 | ; NOTE 2: See the section on garbage collection below if you choose to 361 | ; use subdirectories for session storage 362 | ; 363 | ; The file storage module creates files using mode 600 by default. 364 | ; You can change that by using 365 | ; 366 | ; session.save_path = "N;MODE;/path" 367 | ; 368 | ; where MODE is the octal representation of the mode. Note that this 369 | ; does not overwrite the process's umask. 370 | ; http://php.net/session.save-path 371 | ;session.save_path = "/tmp" 372 | 373 | ; Whether to use strict session mode. 374 | ; Strict session mode does not accept an uninitialized session ID, and 375 | ; regenerates the session ID if the browser sends an uninitialized session ID. 376 | ; Strict mode protects applications from session fixation via a session adoption 377 | ; vulnerability. It is disabled by default for maximum compatibility, but 378 | ; enabling it is encouraged. 379 | ; https://wiki.php.net/rfc/strict_sessions 380 | session.use_strict_mode = 0 381 | 382 | ; Whether to use cookies. 383 | ; http://php.net/session.use-cookies 384 | session.use_cookies = 1 385 | 386 | ; http://php.net/session.cookie-secure 387 | ;session.cookie_secure = 388 | 389 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 390 | ; the session id. We encourage this operation as it's very helpful in combating 391 | ; session hijacking when not specifying and managing your own session id. It is 392 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 393 | ; http://php.net/session.use-only-cookies 394 | session.use_only_cookies = 1 395 | 396 | ; Name of the session (used as cookie name). 397 | ; http://php.net/session.name 398 | session.name = PHPSESSID 399 | 400 | ; Initialize session on request startup. 401 | ; http://php.net/session.auto-start 402 | session.auto_start = 0 403 | 404 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 405 | ; http://php.net/session.cookie-lifetime 406 | session.cookie_lifetime = 0 407 | 408 | ; The path for which the cookie is valid. 409 | ; http://php.net/session.cookie-path 410 | session.cookie_path = / 411 | 412 | ; The domain for which the cookie is valid. 413 | ; http://php.net/session.cookie-domain 414 | session.cookie_domain = 415 | 416 | ; Whether or not to add the httpOnly flag to the cookie, which makes it 417 | ; inaccessible to browser scripting languages such as JavaScript. 418 | ; http://php.net/session.cookie-httponly 419 | session.cookie_httponly = 420 | 421 | ; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF) 422 | ; Current valid values are "Strict", "Lax" or "None". When using "None", 423 | ; make sure to include the quotes, as `none` is interpreted like `false` in ini files. 424 | ; https://tools.ietf.org/html/draft-west-first-party-cookies-07 425 | session.cookie_samesite = 426 | 427 | ; Handler used to serialize data. php is the standard serializer of PHP. 428 | ; http://php.net/session.serialize-handler 429 | session.serialize_handler = php 430 | 431 | ; Defines the probability that the 'garbage collection' process is started on every 432 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 433 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 434 | ; Default Value: 1 435 | ; Development Value: 1 436 | ; Production Value: 1 437 | ; http://php.net/session.gc-probability 438 | session.gc_probability = 1 439 | 440 | ; Defines the probability that the 'garbage collection' process is started on every 441 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 442 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 443 | ; For high volume production servers, using a value of 1000 is a more efficient approach. 444 | ; Default Value: 100 445 | ; Development Value: 1000 446 | ; Production Value: 1000 447 | ; http://php.net/session.gc-divisor 448 | session.gc_divisor = 1000 449 | 450 | ; After this number of seconds, stored data will be seen as 'garbage' and 451 | ; cleaned up by the garbage collection process. 452 | ; http://php.net/session.gc-maxlifetime 453 | session.gc_maxlifetime = 1440 454 | 455 | ; NOTE: If you are using the subdirectory option for storing session files 456 | ; (see session.save_path above), then garbage collection does *not* 457 | ; happen automatically. You will need to do your own garbage 458 | ; collection through a shell script, cron entry, or some other method. 459 | ; For example, the following script is the equivalent of setting 460 | ; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 461 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 462 | 463 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 464 | ; HTTP_REFERER has to contain this substring for the session to be 465 | ; considered as valid. 466 | ; http://php.net/session.referer-check 467 | session.referer_check = 468 | 469 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 470 | ; or leave this empty to avoid sending anti-caching headers. 471 | ; http://php.net/session.cache-limiter 472 | session.cache_limiter = nocache 473 | 474 | ; Document expires after n minutes. 475 | ; http://php.net/session.cache-expire 476 | session.cache_expire = 180 477 | 478 | ; trans sid support is disabled by default. 479 | ; Use of trans sid may risk your users' security. 480 | ; Use this option with caution. 481 | ; - User may send URL contains active session ID 482 | ; to other person via. email/irc/etc. 483 | ; - URL that contains active session ID may be stored 484 | ; in publicly accessible computer. 485 | ; - User may access your site with the same session ID 486 | ; always using URL stored in browser's history or bookmarks. 487 | ; http://php.net/session.use-trans-sid 488 | session.use_trans_sid = 0 489 | 490 | ; Set session ID character length. This value could be between 22 to 256. 491 | ; Shorter length than default is supported only for compatibility reason. 492 | ; Users should use 32 or more chars. 493 | ; http://php.net/session.sid-length 494 | ; Default Value: 32 495 | ; Development Value: 26 496 | ; Production Value: 26 497 | session.sid_length = 26 498 | 499 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 500 | ;
is special; if you include them here, the rewriter will 501 | ; add a hidden field with the info which is otherwise appended 502 | ; to URLs. tag's action attribute URL will not be modified 503 | ; unless it is specified. 504 | ; Note that all valid entries require a "=", even if no value follows. 505 | ; Default Value: "a=href,area=href,frame=src,form=" 506 | ; Development Value: "a=href,area=href,frame=src,form=" 507 | ; Production Value: "a=href,area=href,frame=src,form=" 508 | ; http://php.net/url-rewriter.tags 509 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 510 | 511 | ; URL rewriter does not rewrite absolute URLs by default. 512 | ; To enable rewrites for absolute paths, target hosts must be specified 513 | ; at RUNTIME. i.e. use ini_set() 514 | ; tags is special. PHP will check action attribute's URL regardless 515 | ; of session.trans_sid_tags setting. 516 | ; If no host is defined, HTTP_HOST will be used for allowed host. 517 | ; Example value: php.net,www.php.net,wiki.php.net 518 | ; Use "," for multiple hosts. No spaces are allowed. 519 | ; Default Value: "" 520 | ; Development Value: "" 521 | ; Production Value: "" 522 | ;session.trans_sid_hosts="" 523 | 524 | ; Define how many bits are stored in each character when converting 525 | ; the binary hash data to something readable. 526 | ; Possible values: 527 | ; 4 (4 bits: 0-9, a-f) 528 | ; 5 (5 bits: 0-9, a-v) 529 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 530 | ; Default Value: 4 531 | ; Development Value: 5 532 | ; Production Value: 5 533 | ; http://php.net/session.hash-bits-per-character 534 | session.sid_bits_per_character = 5 535 | 536 | ; Enable upload progress tracking in $_SESSION 537 | ; Default Value: On 538 | ; Development Value: On 539 | ; Production Value: On 540 | ; http://php.net/session.upload-progress.enabled 541 | ;session.upload_progress.enabled = On 542 | 543 | ; Cleanup the progress information as soon as all POST data has been read 544 | ; (i.e. upload completed). 545 | ; Default Value: On 546 | ; Development Value: On 547 | ; Production Value: On 548 | ; http://php.net/session.upload-progress.cleanup 549 | ;session.upload_progress.cleanup = On 550 | 551 | ; A prefix used for the upload progress key in $_SESSION 552 | ; Default Value: "upload_progress_" 553 | ; Development Value: "upload_progress_" 554 | ; Production Value: "upload_progress_" 555 | ; http://php.net/session.upload-progress.prefix 556 | ;session.upload_progress.prefix = "upload_progress_" 557 | 558 | ; The index name (concatenated with the prefix) in $_SESSION 559 | ; containing the upload progress information 560 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 561 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 562 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 563 | ; http://php.net/session.upload-progress.name 564 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 565 | 566 | ; How frequently the upload progress should be updated. 567 | ; Given either in percentages (per-file), or in bytes 568 | ; Default Value: "1%" 569 | ; Development Value: "1%" 570 | ; Production Value: "1%" 571 | ; http://php.net/session.upload-progress.freq 572 | ;session.upload_progress.freq = "1%" 573 | 574 | ; The minimum delay between updates, in seconds 575 | ; Default Value: 1 576 | ; Development Value: 1 577 | ; Production Value: 1 578 | ; http://php.net/session.upload-progress.min-freq 579 | ;session.upload_progress.min_freq = "1" 580 | 581 | ; Only write session data when session data is changed. Enabled by default. 582 | ; http://php.net/session.lazy-write 583 | ;session.lazy_write = On 584 | -------------------------------------------------------------------------------- /.helm/laravel-worker-values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for laravel-helm. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | nameOverride: "" 8 | fullnameOverride: "" 9 | imagePullSecrets: [] 10 | 11 | # Configure Laravel Worker container. 12 | app: 13 | image: 14 | repository: quay.io/renokico/laravel-helm-demo 15 | pullPolicy: IfNotPresent 16 | tag: "worker-0.6.0" 17 | 18 | # The command to run and keep alive on the worker. 19 | command: php artisan queue:work 20 | 21 | # Specify the Secret name to pull the .env file from. 22 | # If not specified, it defaults to "{release name}-env". It should 23 | # be a secret that contains an ".env" data key with the full 24 | # .env file that will be copied during pod creation. 25 | # The secret should be created by you before running the app. 26 | envSecretName: "laravel-env" 27 | 28 | resources: {} 29 | # We usually recommend not to specify default resources and to leave this as a conscious 30 | # choice for the user. This also increases chances charts run on environments with little 31 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 32 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 33 | # limits: 34 | # cpu: 100m 35 | # memory: 128Mi 36 | # requests: 37 | # cpu: 100m 38 | # memory: 128Mi 39 | 40 | # Extra environment variables for the app container. 41 | extraEnv: [] 42 | # - name: POD_NAME 43 | # valueFrom: 44 | # fieldRef: 45 | # fieldPath: metadata.name 46 | 47 | # Extra volumes to mount on the container. 48 | extraVolumeMounts: [] 49 | # - name: some-folder 50 | # mountPath: /some/path 51 | 52 | serviceAccount: 53 | # Specifies whether a service account should be created 54 | create: true 55 | # Annotations to add to the service account 56 | annotations: {} 57 | # The name of the service account to use. 58 | # If not set and create is true, a name is generated using the fullname template 59 | name: "" 60 | 61 | podAnnotations: {} 62 | 63 | podSecurityContext: {} 64 | # fsGroup: 2000 65 | 66 | securityContext: {} 67 | # capabilities: 68 | # drop: 69 | # - ALL 70 | # readOnlyRootFilesystem: true 71 | # runAsNonRoot: true 72 | # runAsUser: 1000 73 | 74 | service: 75 | enabled: false 76 | type: ClusterIP 77 | port: 80 78 | 79 | annotations: {} 80 | # Set annotations for the service. 81 | 82 | ingress: 83 | enabled: false 84 | annotations: {} 85 | # kubernetes.io/ingress.class: nginx 86 | # kubernetes.io/tls-acme: "true" 87 | hosts: 88 | - host: test.laravel.com 89 | paths: 90 | - / 91 | tls: [] 92 | # - secretName: chart-example-tls 93 | # hosts: 94 | # - chart-example.local 95 | 96 | autoscaling: 97 | enabled: true 98 | minReplicas: 1 99 | maxReplicas: 10 100 | targetMemoryUtilizationPercentage: 70 101 | # targetCPUUtilizationPercentage: 80 102 | 103 | behavior: {} 104 | # Set the behavior for the autoscaler. 105 | # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior 106 | 107 | # Custom Metrics will be appended to the default CPU/Memory resources (if they're enabled). 108 | customMetrics: [] 109 | # - type: Pods 110 | # pods: 111 | # metric: 112 | # name: phpfpm_process_utilization 113 | # target: 114 | # type: AverageValue 115 | # averageValue: "50" 116 | 117 | pdb: 118 | enabled: true 119 | minAvailable: 1 120 | # maxUnavailable: 25% 121 | 122 | nodeSelector: {} 123 | 124 | tolerations: [] 125 | 126 | affinity: {} 127 | 128 | # Extra volumes to attach to the deployment. 129 | extraVolumes: [] 130 | # - name: some-folder 131 | # emptyDir: {} 132 | 133 | # Extra containers to run in the deployment. 134 | extraContainers: [] 135 | 136 | # Extra init containers to run in the deployment. 137 | extraInitContainers: [] 138 | 139 | # Configure the php.ini used for the PHP process. 140 | # This will overwrite the default ones that exists in the container. 141 | phpIni: 142 | # Specify the Config name to pull the php.ini configuration from. 143 | # If not specified, it defaults to "{release name}-php-ini-config". 144 | # This will be automatically be created for you if you do not specify it. 145 | # configName: "" 146 | 147 | # If no configName is specified, this will be the config 148 | # applied to the app container. 149 | content: | 150 | ; Determines if Zend OPCache is enabled 151 | opcache.enable=1 152 | 153 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 154 | opcache.enable_cli=1 155 | 156 | ; The OPcache shared memory storage size. 157 | opcache.memory_consumption=128 158 | 159 | ; The amount of memory for interned strings in Mbytes. 160 | opcache.interned_strings_buffer=128 161 | 162 | ; The maximum number of keys (scripts) in the OPcache hash table. 163 | ; Only numbers between 200 and 1000000 are allowed. 164 | opcache.max_accelerated_files=1000000 165 | 166 | ; maximum memory allocated to store the results 167 | realpath_cache_size=8192K 168 | 169 | ; save the results for 10 minutes (600 seconds) 170 | realpath_cache_ttl=600 171 | 172 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 173 | opcache.max_wasted_percentage=5 174 | 175 | ; When this directive is enabled, the OPcache appends the current working 176 | ; directory to the script key, thus eliminating possible collisions between 177 | ; files with the same name (basename). Disabling the directive improves 178 | ; performance, but may break existing applications. 179 | ;opcache.use_cwd=1 180 | 181 | ; When disabled, you must reset the OPcache manually or restart the 182 | ; webserver for changes to the filesystem to take effect. 183 | opcache.validate_timestamps=0 184 | 185 | ; How often (in seconds) to check file timestamps for changes to the shared 186 | ; memory storage allocation. ("1" means validate once per second, but only 187 | ; once per request. "0" means always validate) 188 | opcache.revalidate_freq=0 189 | 190 | ; Enables or disables file search in include_path optimization 191 | ;opcache.revalidate_path=0 192 | 193 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 194 | ; size of the optimized code. 195 | ;opcache.save_comments=1 196 | 197 | ; If enabled, a fast shutdown sequence is used for the accelerated code 198 | ; Depending on the used Memory Manager this may cause some incompatibilities. 199 | opcache.fast_shutdown=1 200 | 201 | ; Allow file existence override (file_exists, etc.) performance feature. 202 | ;opcache.enable_file_override=0 203 | 204 | ; A bitmask, where each bit enables or disables the appropriate OPcache 205 | ; passes 206 | ;opcache.optimization_level=0xffffffff 207 | 208 | ;opcache.inherited_hack=1 209 | ;opcache.dups_fix=0 210 | 211 | ; The location of the OPcache blacklist file (wildcards allowed). 212 | ; Each OPcache blacklist file is a text file that holds the names of files 213 | ; that should not be accelerated. 214 | opcache.blacklist_filename=/etc/php-*/opcache*.blacklist 215 | 216 | ; Allows exclusion of large files from being cached. By default all files 217 | ; are cached. 218 | ;opcache.max_file_size=0 219 | 220 | ; Check the cache checksum each N requests. 221 | ; The default value of "0" means that the checks are disabled. 222 | ;opcache.consistency_checks=0 223 | 224 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 225 | ; is not being accessed. 226 | ;opcache.force_restart_timeout=180 227 | 228 | ; OPcache error_log file name. Empty string assumes "stderr". 229 | ;opcache.error_log= 230 | 231 | ; All OPcache errors go to the Web server log. 232 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 233 | ; You can also enable warnings (level 2), info messages (level 3) or 234 | ; debug messages (level 4). 235 | ;opcache.log_verbosity_level=1 236 | 237 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 238 | ;opcache.preferred_memory_model= 239 | 240 | ; Protect the shared memory from unexpected writing during script execution. 241 | ; Useful for internal debugging only. 242 | ;opcache.protect_memory=0 243 | 244 | ; Allows calling OPcache API functions only from PHP scripts which path is 245 | ; started from specified string. The default "" means no restriction 246 | ;opcache.restrict_api= 247 | 248 | ; Enables and sets the second level cache directory. 249 | ; It should improve performance when SHM memory is full, at server restart or 250 | ; SHM reset. The default "" disables file based caching. 251 | ; RPM note : file cache directory must be owned by process owner 252 | ; for mod_php, see /etc/httpd/conf.d/php.conf 253 | ; for php-fpm, see /etc/php-fpm.d/*conf 254 | ;opcache.file_cache= 255 | 256 | ; Enables or disables opcode caching in shared memory. 257 | ;opcache.file_cache_only=0 258 | 259 | ; Enables or disables checksum validation when script loaded from file cache. 260 | ;opcache.file_cache_consistency_checks=1 261 | 262 | ; Implies opcache.file_cache_only=1 for a certain process that failed to 263 | ; reattach to the shared memory (for Windows only). Explicitly enabled file 264 | ; cache is required. 265 | ;opcache.file_cache_fallback=1 266 | 267 | ; Validate cached file permissions. 268 | ; Leads OPcache to check file readability on each access to cached file. 269 | ; This directive should be enabled in shared hosting environment, when few 270 | ; users (PHP-FPM pools) reuse the common OPcache shared memory. 271 | ;opcache.validate_permission=0 272 | 273 | ; Prevent name collisions in chroot'ed environment. 274 | ; This directive prevents file name collisions in different "chroot" 275 | ; environments. It should be enabled for sites that may serve requests in 276 | ; different "chroot" environments. 277 | ;opcache.validate_root=0 278 | 279 | ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. 280 | ; This should improve performance, but requires appropriate OS configuration. 281 | opcache.huge_code_pages=1 282 | 283 | ; Maximum amount of memory a script may consume 284 | ; http://php.net/memory-limit 285 | memory_limit = 128M 286 | 287 | ; Maximum execution time of each script, in seconds 288 | ; http://php.net/max-execution-time 289 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 290 | max_execution_time = 30 291 | 292 | ;;;;;;;;;;;;;;;; 293 | ; File Uploads ; 294 | ;;;;;;;;;;;;;;;; 295 | 296 | ; Whether to allow HTTP file uploads. 297 | ; http://php.net/file-uploads 298 | file_uploads = On 299 | 300 | ; Temporary directory for HTTP uploaded files (will use system default if not 301 | ; specified). 302 | ; http://php.net/upload-tmp-dir 303 | ;upload_tmp_dir = 304 | 305 | ; Maximum allowed size for uploaded files. 306 | ; http://php.net/upload-max-filesize 307 | upload_max_filesize = 2M 308 | 309 | ; Maximum number of files that can be uploaded via a single request 310 | max_file_uploads = 20 311 | 312 | ;;;;;;;;;;;;;;;;;; 313 | ; Fopen wrappers ; 314 | ;;;;;;;;;;;;;;;;;; 315 | 316 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 317 | ; http://php.net/allow-url-fopen 318 | allow_url_fopen = On 319 | 320 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 321 | ; http://php.net/allow-url-include 322 | allow_url_include = Off 323 | 324 | [Session] 325 | ; Handler used to store/retrieve data. 326 | ; http://php.net/session.save-handler 327 | session.save_handler = files 328 | 329 | ; Argument passed to save_handler. In the case of files, this is the path 330 | ; where data files are stored. Note: Windows users have to change this 331 | ; variable in order to use PHP's session functions. 332 | ; 333 | ; The path can be defined as: 334 | ; 335 | ; session.save_path = "N;/path" 336 | ; 337 | ; where N is an integer. Instead of storing all the session files in 338 | ; /path, what this will do is use subdirectories N-levels deep, and 339 | ; store the session data in those directories. This is useful if 340 | ; your OS has problems with many files in one directory, and is 341 | ; a more efficient layout for servers that handle many sessions. 342 | ; 343 | ; NOTE 1: PHP will not create this directory structure automatically. 344 | ; You can use the script in the ext/session dir for that purpose. 345 | ; NOTE 2: See the section on garbage collection below if you choose to 346 | ; use subdirectories for session storage 347 | ; 348 | ; The file storage module creates files using mode 600 by default. 349 | ; You can change that by using 350 | ; 351 | ; session.save_path = "N;MODE;/path" 352 | ; 353 | ; where MODE is the octal representation of the mode. Note that this 354 | ; does not overwrite the process's umask. 355 | ; http://php.net/session.save-path 356 | ;session.save_path = "/tmp" 357 | 358 | ; Whether to use strict session mode. 359 | ; Strict session mode does not accept an uninitialized session ID, and 360 | ; regenerates the session ID if the browser sends an uninitialized session ID. 361 | ; Strict mode protects applications from session fixation via a session adoption 362 | ; vulnerability. It is disabled by default for maximum compatibility, but 363 | ; enabling it is encouraged. 364 | ; https://wiki.php.net/rfc/strict_sessions 365 | session.use_strict_mode = 0 366 | 367 | ; Whether to use cookies. 368 | ; http://php.net/session.use-cookies 369 | session.use_cookies = 1 370 | 371 | ; http://php.net/session.cookie-secure 372 | ;session.cookie_secure = 373 | 374 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 375 | ; the session id. We encourage this operation as it's very helpful in combating 376 | ; session hijacking when not specifying and managing your own session id. It is 377 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 378 | ; http://php.net/session.use-only-cookies 379 | session.use_only_cookies = 1 380 | 381 | ; Name of the session (used as cookie name). 382 | ; http://php.net/session.name 383 | session.name = PHPSESSID 384 | 385 | ; Initialize session on request startup. 386 | ; http://php.net/session.auto-start 387 | session.auto_start = 0 388 | 389 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 390 | ; http://php.net/session.cookie-lifetime 391 | session.cookie_lifetime = 0 392 | 393 | ; The path for which the cookie is valid. 394 | ; http://php.net/session.cookie-path 395 | session.cookie_path = / 396 | 397 | ; The domain for which the cookie is valid. 398 | ; http://php.net/session.cookie-domain 399 | session.cookie_domain = 400 | 401 | ; Whether or not to add the httpOnly flag to the cookie, which makes it 402 | ; inaccessible to browser scripting languages such as JavaScript. 403 | ; http://php.net/session.cookie-httponly 404 | session.cookie_httponly = 405 | 406 | ; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF) 407 | ; Current valid values are "Strict", "Lax" or "None". When using "None", 408 | ; make sure to include the quotes, as `none` is interpreted like `false` in ini files. 409 | ; https://tools.ietf.org/html/draft-west-first-party-cookies-07 410 | session.cookie_samesite = 411 | 412 | ; Handler used to serialize data. php is the standard serializer of PHP. 413 | ; http://php.net/session.serialize-handler 414 | session.serialize_handler = php 415 | 416 | ; Defines the probability that the 'garbage collection' process is started on every 417 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 418 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 419 | ; Default Value: 1 420 | ; Development Value: 1 421 | ; Production Value: 1 422 | ; http://php.net/session.gc-probability 423 | session.gc_probability = 1 424 | 425 | ; Defines the probability that the 'garbage collection' process is started on every 426 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 427 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 428 | ; For high volume production servers, using a value of 1000 is a more efficient approach. 429 | ; Default Value: 100 430 | ; Development Value: 1000 431 | ; Production Value: 1000 432 | ; http://php.net/session.gc-divisor 433 | session.gc_divisor = 1000 434 | 435 | ; After this number of seconds, stored data will be seen as 'garbage' and 436 | ; cleaned up by the garbage collection process. 437 | ; http://php.net/session.gc-maxlifetime 438 | session.gc_maxlifetime = 1440 439 | 440 | ; NOTE: If you are using the subdirectory option for storing session files 441 | ; (see session.save_path above), then garbage collection does *not* 442 | ; happen automatically. You will need to do your own garbage 443 | ; collection through a shell script, cron entry, or some other method. 444 | ; For example, the following script is the equivalent of setting 445 | ; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 446 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 447 | 448 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 449 | ; HTTP_REFERER has to contain this substring for the session to be 450 | ; considered as valid. 451 | ; http://php.net/session.referer-check 452 | session.referer_check = 453 | 454 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 455 | ; or leave this empty to avoid sending anti-caching headers. 456 | ; http://php.net/session.cache-limiter 457 | session.cache_limiter = nocache 458 | 459 | ; Document expires after n minutes. 460 | ; http://php.net/session.cache-expire 461 | session.cache_expire = 180 462 | 463 | ; trans sid support is disabled by default. 464 | ; Use of trans sid may risk your users' security. 465 | ; Use this option with caution. 466 | ; - User may send URL contains active session ID 467 | ; to other person via. email/irc/etc. 468 | ; - URL that contains active session ID may be stored 469 | ; in publicly accessible computer. 470 | ; - User may access your site with the same session ID 471 | ; always using URL stored in browser's history or bookmarks. 472 | ; http://php.net/session.use-trans-sid 473 | session.use_trans_sid = 0 474 | 475 | ; Set session ID character length. This value could be between 22 to 256. 476 | ; Shorter length than default is supported only for compatibility reason. 477 | ; Users should use 32 or more chars. 478 | ; http://php.net/session.sid-length 479 | ; Default Value: 32 480 | ; Development Value: 26 481 | ; Production Value: 26 482 | session.sid_length = 26 483 | 484 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 485 | ; is special; if you include them here, the rewriter will 486 | ; add a hidden field with the info which is otherwise appended 487 | ; to URLs. tag's action attribute URL will not be modified 488 | ; unless it is specified. 489 | ; Note that all valid entries require a "=", even if no value follows. 490 | ; Default Value: "a=href,area=href,frame=src,form=" 491 | ; Development Value: "a=href,area=href,frame=src,form=" 492 | ; Production Value: "a=href,area=href,frame=src,form=" 493 | ; http://php.net/url-rewriter.tags 494 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 495 | 496 | ; URL rewriter does not rewrite absolute URLs by default. 497 | ; To enable rewrites for absolute paths, target hosts must be specified 498 | ; at RUNTIME. i.e. use ini_set() 499 | ; tags is special. PHP will check action attribute's URL regardless 500 | ; of session.trans_sid_tags setting. 501 | ; If no host is defined, HTTP_HOST will be used for allowed host. 502 | ; Example value: php.net,www.php.net,wiki.php.net 503 | ; Use "," for multiple hosts. No spaces are allowed. 504 | ; Default Value: "" 505 | ; Development Value: "" 506 | ; Production Value: "" 507 | ;session.trans_sid_hosts="" 508 | 509 | ; Define how many bits are stored in each character when converting 510 | ; the binary hash data to something readable. 511 | ; Possible values: 512 | ; 4 (4 bits: 0-9, a-f) 513 | ; 5 (5 bits: 0-9, a-v) 514 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 515 | ; Default Value: 4 516 | ; Development Value: 5 517 | ; Production Value: 5 518 | ; http://php.net/session.hash-bits-per-character 519 | session.sid_bits_per_character = 5 520 | 521 | ; Enable upload progress tracking in $_SESSION 522 | ; Default Value: On 523 | ; Development Value: On 524 | ; Production Value: On 525 | ; http://php.net/session.upload-progress.enabled 526 | ;session.upload_progress.enabled = On 527 | 528 | ; Cleanup the progress information as soon as all POST data has been read 529 | ; (i.e. upload completed). 530 | ; Default Value: On 531 | ; Development Value: On 532 | ; Production Value: On 533 | ; http://php.net/session.upload-progress.cleanup 534 | ;session.upload_progress.cleanup = On 535 | 536 | ; A prefix used for the upload progress key in $_SESSION 537 | ; Default Value: "upload_progress_" 538 | ; Development Value: "upload_progress_" 539 | ; Production Value: "upload_progress_" 540 | ; http://php.net/session.upload-progress.prefix 541 | ;session.upload_progress.prefix = "upload_progress_" 542 | 543 | ; The index name (concatenated with the prefix) in $_SESSION 544 | ; containing the upload progress information 545 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 546 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 547 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 548 | ; http://php.net/session.upload-progress.name 549 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 550 | 551 | ; How frequently the upload progress should be updated. 552 | ; Given either in percentages (per-file), or in bytes 553 | ; Default Value: "1%" 554 | ; Development Value: "1%" 555 | ; Production Value: "1%" 556 | ; http://php.net/session.upload-progress.freq 557 | ;session.upload_progress.freq = "1%" 558 | 559 | ; The minimum delay between updates, in seconds 560 | ; Default Value: 1 561 | ; Development Value: 1 562 | ; Production Value: 1 563 | ; http://php.net/session.upload-progress.min-freq 564 | ;session.upload_progress.min_freq = "1" 565 | 566 | ; Only write session data when session data is changed. Enabled by default. 567 | ; http://php.net/session.lazy-write 568 | ;session.lazy_write = On 569 | -------------------------------------------------------------------------------- /.helm/secret.yaml: -------------------------------------------------------------------------------- 1 | kind: Secret 2 | apiVersion: v1 3 | metadata: 4 | name: laravel-env 5 | stringData: 6 | .env: | 7 | APP_NAME=Laravel 8 | APP_ENV=local 9 | APP_KEY=base64:kLHmdtqS0YnTACWSpkV4w1GVOQMEXQ68Usk8WR+yauA= 10 | APP_DEBUG=true 11 | APP_URL=http://test.laravel.com 12 | 13 | LOG_CHANNEL=null 14 | LOG_LEVEL=debug 15 | 16 | DB_CONNECTION=mysql 17 | DB_HOST=127.0.0.1 18 | DB_PORT=3306 19 | DB_DATABASE=laravel 20 | DB_USERNAME=root 21 | DB_PASSWORD= 22 | 23 | BROADCAST_DRIVER=log 24 | CACHE_DRIVER=file 25 | QUEUE_CONNECTION=sync 26 | SESSION_DRIVER=file 27 | SESSION_LIFETIME=120 28 | 29 | MEMCACHED_HOST=127.0.0.1 30 | 31 | REDIS_HOST=127.0.0.1 32 | REDIS_PASSWORD=null 33 | REDIS_PORT=6379 34 | 35 | MAIL_MAILER=smtp 36 | MAIL_HOST=mailhog 37 | MAIL_PORT=1025 38 | MAIL_USERNAME=null 39 | MAIL_PASSWORD=null 40 | MAIL_ENCRYPTION=null 41 | MAIL_FROM_ADDRESS=null 42 | MAIL_FROM_NAME="${APP_NAME}" 43 | 44 | AWS_ACCESS_KEY_ID= 45 | AWS_SECRET_ACCESS_KEY= 46 | AWS_DEFAULT_REGION=us-east-1 47 | AWS_BUCKET= 48 | 49 | PUSHER_APP_ID= 50 | PUSHER_APP_KEY= 51 | PUSHER_APP_SECRET= 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 55 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 56 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - no_unused_imports 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /Dockerfile.fpm: -------------------------------------------------------------------------------- 1 | # https://github.com/renoki-co/laravel-docker-base 2 | FROM quay.io/renokico/laravel-base:1.2.0-8.0-fpm-alpine 3 | 4 | COPY . /var/www/html 5 | 6 | RUN mkdir -p /var/www/html/storage/logs/ && \ 7 | chown -R www-data:www-data /var/www/html && \ 8 | rm -rf tests/ .git/ .github/ *.md && \ 9 | rm -rf vendor/*/test/ vendor/*/tests/* 10 | 11 | WORKDIR /var/www/html 12 | -------------------------------------------------------------------------------- /Dockerfile.octane: -------------------------------------------------------------------------------- 1 | # https://github.com/renoki-co/laravel-docker-base 2 | FROM quay.io/renokico/laravel-base:octane-1.1.0-4.6-php8.0-alpine 3 | 4 | COPY . /var/www/html 5 | 6 | RUN mkdir -p /var/www/html/storage/logs/ && \ 7 | chown -R www-data:www-data /var/www/html && \ 8 | rm -rf tests/ .git/ .github/ *.md && \ 9 | rm -rf vendor/*/test/ vendor/*/tests/* 10 | 11 | WORKDIR /var/www/html 12 | 13 | ENTRYPOINT ["php", "-d", "variables_order=EGPCS", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=80"] 14 | 15 | EXPOSE 80 16 | -------------------------------------------------------------------------------- /Dockerfile.worker: -------------------------------------------------------------------------------- 1 | # https://github.com/renoki-co/laravel-docker-base 2 | FROM quay.io/renokico/laravel-base:worker-1.2.0-8.0-cli-alpine 3 | 4 | COPY . /var/www/html 5 | 6 | RUN mkdir -p /var/www/html/storage/logs/ && \ 7 | chown -R www-data:www-data /var/www/html && \ 8 | rm -rf tests/ .git/ .github/ *.md && \ 9 | rm -rf vendor/*/test/ vendor/*/tests/* 10 | 11 | WORKDIR /var/www/html 12 | 13 | ENTRYPOINT ["php", "-a"] 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | - [Laravel Helm Demo](#laravel-helm-demo) 2 | - [🤝 Supporting](#-supporting) 3 | - [Building Image](#building-image) 4 | - [NGINX + PHP-FPM](#nginx--php-fpm) 5 | - [Octane](#octane) 6 | - [Workers](#workers) 7 | - [Installing Dependencies](#installing-dependencies) 8 | - [Deploy Script](#deploy-script) 9 | - [Deploying on Kubernetes](#deploying-on-kubernetes) 10 | - [Deploying Chart](#deploying-chart) 11 | - [Configuring Environment Variables](#configuring-environment-variables) 12 | - [Database](#database) 13 | - [Filesystems](#filesystems) 14 | - [Autoscaling](#autoscaling) 15 | - [Scaling Horizon & Octane](#scaling-horizon--octane) 16 | 17 | # Laravel Helm Demo 18 | 19 | Run Laravel on Kubernetes using Helm. This project is horizontal scale-ready, and it can either be used with NGINX + PHP-FPM or Octane. 20 | 21 | ## 🤝 Supporting 22 | 23 | **If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with [Github Sponsors](https://github.com/sponsors/rennokki). 📦** 24 | 25 | [](https://github-content.renoki.org/github-repo/25) 26 | 27 | ## Building Image 28 | 29 | This project offers three alternative to build an image: 30 | 31 | - for PHP-FPM + NGINX projects (using `Dockerfile.fpm`) 32 | - for Octane (using `Dockerfile.octane`) 33 | - for Workers (like CLI commands, using `Dockerfile.worker`) 34 | 35 | All images are based on [Laravel Docker Base images](https://github.com/renoki-co/laravel-docker-base), a small repository that contains Dockerfiles that already compile the extensions and enable them, to speed up the project deployment, since the same extensions are always installed during the normal project CI/CD pipeline. 36 | 37 | ### NGINX + PHP-FPM 38 | 39 | The images generated with NGINX + PHP-FPM are using [renoki-co/laravel chart](https://github.com/renoki-co/charts/tree/master/charts/laravel) and you may find there the documentation on how to deploy the chart. 40 | 41 | Basically, the final Docker image will be built using the `Dockerfile.fpm` file. It includes logs creation, permission changes and eventually clearing up additional files that you may not want to clutter your image with. 42 | 43 | ### Octane 44 | 45 | The images generated with Octane are using [renoki-co/laravel-octane chart](https://github.com/renoki-co/charts/tree/master/charts/laravel-octane) and you may find there the documentation on how to deploy the chart. 46 | 47 | The `Dockerfile.octane` file will guide the image to be built in the same manner as the usual PHP-FPM version, but it comes with a lightweight PHP-Swoole image to start from. The defined entrypoint command can be later replaced in the Kubernetes Deployment configuration. 48 | 49 | ### Workers 50 | 51 | The images generated for Workers are using [renoki-co/laravel-worker chart](https://github.com/renoki-co/charts/tree/master/charts/laravel-worker) and you may find there the documentation on how to deploy the chart. 52 | 53 | Workers need only the PHP CLI to be available. It's almost like Octane, but some processes do not require Swoole, like Horizon. 54 | 55 | ### Installing Dependencies 56 | 57 | It's recommended that the dependencies and other static data to be installed alongside with the container in CI/CD pipeline. This way, your pods will not take additional time each time they start to complete additional long steps like installing the dependencies or compiling the frontend assets. 58 | 59 | In this demo project, in `.github/workflows/docker-release-tag.yml`, for example, the CI/CD pipeline will run additional steps like `composer install` and build the image. The final build will have dependencies already installed and you will be easily be implementing a fast-responding app, which is ready to scale really fast. 60 | 61 | ### Deploy Script 62 | 63 | In the project root, you will find a `deploy.sh` file that will contains additional steps to run on each Pod startup. You might change it according to your needs, but keep in mind that it shouldn't take too much. The more it takes, the slower your scaling up will be. 64 | 65 | In this file you may run additional steps that depend on your `.env` file, as at the Pod startup, the `.env` file is injected via the Secret kind. 66 | 67 | Commands like `php artisan migrate` or `php artisan route:cache` are the most appropriate ones to run here. 68 | 69 | ## Deploying on Kubernetes 70 | 71 | ### Deploying Chart 72 | 73 | A brief example can be found in `.helm/deploy.sh` on how to deploy a Laravel Octane application. You will also find optional Helm releases that might help you deploying the application, such as Prometheus for PHP-FPM + NGINX scaling or NGINX Ingress Controller to port NGINX to the app service. 74 | 75 | ### Configuring Environment Variables 76 | 77 | The nature of Laravel (as Deployment Kind) in Kubernetes is to be stateless. Meaning that the pods (holding the images built earlier) are created and destroyed without any persistence between roll-outs or roll-ins. To preserve this, the `.env` file is mounted as a `Secret` kind, and once the Pod creates, the contents of the secret is spilled out in the `.env` file within the pod. 78 | 79 | These secrets can be encrypted at rest. For example, in AWS, you can specify [to encrypt Secret kinds with KMS](https://aws.amazon.com/about-aws/whats-new/2020/03/amazon-eks-adds-envelope-encryption-for-secrets-with-aws-kms/). 80 | 81 | ### Database 82 | 83 | As explained earlier, because the nature of Laravel (or any other app as Deployment) in Kubernetes is to be stateless, you may want to persist data for your application using another service. You can use AWS RDS if you are in AWS, for example. 84 | 85 | You can also deploy your databases, such as MySQL or PostgreSQL, such as [third party Helm Charts](https://bitnami.com/stack/mysql/helm). 86 | 87 | ### Filesystems 88 | 89 | Using local storage will delete all your stored files between pod lifecycles. The best way is to use a third-party service, like AWS S3, Minio, Google Cloud Storage etc. 90 | 91 | ### Autoscaling 92 | 93 | For better understading of autoscaling, Prometheus and Prometheus Adapter may be used to scrap the PHP-FPM Process Manager's active children and scale pods up or down based on the number. 94 | 95 | There is an article that explains the way this works: [Scaling PHP FPM based on utilization demand on Kubernetes](https://blog.wyrihaximus.net/2021/01/scaling-php-fpm-based-on-utilization-demand-on-kubernetes/). 96 | 97 | The only setting you should be aware of is that there are two containers in the Laravel pod that expose metrics. To allow Prometheus to scrape them both, don't use the port annotation on the pod and add the following source label in the Prometheus job ([original gist](https://gist.github.com/bakins/5bf7d4e719f36c1c555d81134d8887eb)): 98 | 99 | ```yaml 100 | jobs: 101 | - job_name: 'kubernetes-pods' 102 | ... 103 | 104 | relabel_configs: 105 | ... 106 | 107 | - source_labels: [__meta_kubernetes_pod_container_port_name] 108 | action: keep 109 | regex: (.+)-metrics 110 | 111 | ... 112 | ``` 113 | 114 | ### Scaling Horizon & Octane 115 | 116 | It is well known that for Kubernetes, you may scale based on CPU or memory allocated to each pod. But you can also scale based on Prometheus metrics. 117 | 118 | For ease of access, you may use the following exporters for your Laravel application: 119 | 120 | - [Laravel Horizon Exporter](https://github.com/renoki-co/horizon-exporter) - used to scale application pods that run the queue workers 121 | - [Laravel Octane Exporter](https://github.com/renoki-co/octane-exporter) - used to scale the Octane pods to ensure better parallelization 122 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 28 | } 29 | 30 | /** 31 | * Register the commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | $this->load(__DIR__.'/Commands'); 38 | 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | reportable(function (Throwable $e) { 37 | // 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | addHealthcheck('mysql', function (Request $request) { 19 | // Try testing the MySQL connection here 20 | // and return true/false for pass/fail. 21 | 22 | return true; 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 38 | \App\Http\Middleware\VerifyCsrfToken::class, 39 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 40 | ], 41 | 42 | 'api' => [ 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 61 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 62 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 63 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 64 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 65 | ]; 66 | } 67 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | 'datetime', 42 | ]; 43 | } 44 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 39 | 40 | $this->routes(function () { 41 | Route::prefix('api') 42 | ->middleware('api') 43 | ->namespace($this->namespace) 44 | ->group(base_path('routes/api.php')); 45 | 46 | Route::middleware('web') 47 | ->namespace($this->namespace) 48 | ->group(base_path('routes/web.php')); 49 | }); 50 | } 51 | 52 | /** 53 | * Configure the rate limiters for the application. 54 | * 55 | * @return void 56 | */ 57 | protected function configureRateLimiting() 58 | { 59 | RateLimiter::for('api', function (Request $request) { 60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); 61 | }); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.3|^8.0", 12 | "fideloper/proxy": "^4.4", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^7.0.1", 15 | "laravel/framework": "^8.12", 16 | "laravel/octane": "dev-master", 17 | "laravel/tinker": "^2.5", 18 | "renoki-co/laravel-healthchecks": "^1.3" 19 | }, 20 | "require-dev": { 21 | "facade/ignition": "^2.5", 22 | "fakerphp/faker": "^1.9.1", 23 | "laravel/sail": "^1.0.1", 24 | "mockery/mockery": "^1.4.2", 25 | "nunomaduro/collision": "^5.0", 26 | "phpunit/phpunit": "^9.3.3" 27 | }, 28 | "config": { 29 | "optimize-autoloader": true, 30 | "preferred-install": "dist", 31 | "sort-packages": true 32 | }, 33 | "extra": { 34 | "laravel": { 35 | "dont-discover": [] 36 | } 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "App\\": "app/", 41 | "Database\\Factories\\": "database/factories/", 42 | "Database\\Seeders\\": "database/seeders/" 43 | } 44 | }, 45 | "autoload-dev": { 46 | "psr-4": { 47 | "Tests\\": "tests/" 48 | } 49 | }, 50 | "minimum-stability": "dev", 51 | "prefer-stable": true, 52 | "scripts": { 53 | "post-autoload-dump": [ 54 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 55 | "@php artisan package:discover --ansi" 56 | ], 57 | "post-root-package-install": [ 58 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 59 | ], 60 | "post-create-project-cmd": [ 61 | "@php artisan key:generate --ansi" 62 | ] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | your application so that it is used when running Artisan tasks. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | 'asset_url' => env('ASSET_URL', null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Timezone 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the default timezone for your application, which 65 | | will be used by the PHP date and date-time functions. We have gone 66 | | ahead and set this to a sensible default for you out of the box. 67 | | 68 | */ 69 | 70 | 'timezone' => 'UTC', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Locale Configuration 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The application locale determines the default locale that will be used 78 | | by the translation service provider. You are free to set this value 79 | | to any of the locales which will be supported by the application. 80 | | 81 | */ 82 | 83 | 'locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Application Fallback Locale 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The fallback locale determines the locale to use when the current one 91 | | is not available. You may change the value to correspond to any of 92 | | the language folders that are provided through your application. 93 | | 94 | */ 95 | 96 | 'fallback_locale' => 'en', 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Faker Locale 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This locale will be used by the Faker PHP library when generating fake 104 | | data for your database seeds. For example, this will be used to get 105 | | localized telephone numbers, street address information and more. 106 | | 107 | */ 108 | 109 | 'faker_locale' => 'en_US', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Encryption Key 114 | |-------------------------------------------------------------------------- 115 | | 116 | | This key is used by the Illuminate encrypter service and should be set 117 | | to a random, 32 character string, otherwise these encrypted strings 118 | | will not be safe. Please do this before deploying an application! 119 | | 120 | */ 121 | 122 | 'key' => env('APP_KEY'), 123 | 124 | 'cipher' => 'AES-256-CBC', 125 | 126 | /* 127 | |-------------------------------------------------------------------------- 128 | | Autoloaded Service Providers 129 | |-------------------------------------------------------------------------- 130 | | 131 | | The service providers listed here will be automatically loaded on the 132 | | request to your application. Feel free to add your own services to 133 | | this array to grant expanded functionality to your applications. 134 | | 135 | */ 136 | 137 | 'providers' => [ 138 | 139 | /* 140 | * Laravel Framework Service Providers... 141 | */ 142 | Illuminate\Auth\AuthServiceProvider::class, 143 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 144 | Illuminate\Bus\BusServiceProvider::class, 145 | Illuminate\Cache\CacheServiceProvider::class, 146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 147 | Illuminate\Cookie\CookieServiceProvider::class, 148 | Illuminate\Database\DatabaseServiceProvider::class, 149 | Illuminate\Encryption\EncryptionServiceProvider::class, 150 | Illuminate\Filesystem\FilesystemServiceProvider::class, 151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 152 | Illuminate\Hashing\HashServiceProvider::class, 153 | Illuminate\Mail\MailServiceProvider::class, 154 | Illuminate\Notifications\NotificationServiceProvider::class, 155 | Illuminate\Pagination\PaginationServiceProvider::class, 156 | Illuminate\Pipeline\PipelineServiceProvider::class, 157 | Illuminate\Queue\QueueServiceProvider::class, 158 | Illuminate\Redis\RedisServiceProvider::class, 159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 160 | Illuminate\Session\SessionServiceProvider::class, 161 | Illuminate\Translation\TranslationServiceProvider::class, 162 | Illuminate\Validation\ValidationServiceProvider::class, 163 | Illuminate\View\ViewServiceProvider::class, 164 | 165 | /* 166 | * Package Service Providers... 167 | */ 168 | 169 | /* 170 | * Application Service Providers... 171 | */ 172 | App\Providers\AppServiceProvider::class, 173 | App\Providers\AuthServiceProvider::class, 174 | // App\Providers\BroadcastServiceProvider::class, 175 | App\Providers\EventServiceProvider::class, 176 | App\Providers\RouteServiceProvider::class, 177 | 178 | ], 179 | 180 | /* 181 | |-------------------------------------------------------------------------- 182 | | Class Aliases 183 | |-------------------------------------------------------------------------- 184 | | 185 | | This array of class aliases will be registered when this application 186 | | is started. However, feel free to register as many as you wish as 187 | | the aliases are "lazy" loaded so they don't hinder performance. 188 | | 189 | */ 190 | 191 | 'aliases' => [ 192 | 193 | 'App' => Illuminate\Support\Facades\App::class, 194 | 'Arr' => Illuminate\Support\Arr::class, 195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 196 | 'Auth' => Illuminate\Support\Facades\Auth::class, 197 | 'Blade' => Illuminate\Support\Facades\Blade::class, 198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 199 | 'Bus' => Illuminate\Support\Facades\Bus::class, 200 | 'Cache' => Illuminate\Support\Facades\Cache::class, 201 | 'Config' => Illuminate\Support\Facades\Config::class, 202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 204 | 'DB' => Illuminate\Support\Facades\DB::class, 205 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 206 | 'Event' => Illuminate\Support\Facades\Event::class, 207 | 'File' => Illuminate\Support\Facades\File::class, 208 | 'Gate' => Illuminate\Support\Facades\Gate::class, 209 | 'Hash' => Illuminate\Support\Facades\Hash::class, 210 | 'Http' => Illuminate\Support\Facades\Http::class, 211 | 'Lang' => Illuminate\Support\Facades\Lang::class, 212 | 'Log' => Illuminate\Support\Facades\Log::class, 213 | 'Mail' => Illuminate\Support\Facades\Mail::class, 214 | 'Notification' => Illuminate\Support\Facades\Notification::class, 215 | 'Password' => Illuminate\Support\Facades\Password::class, 216 | 'Queue' => Illuminate\Support\Facades\Queue::class, 217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 218 | // 'Redis' => Illuminate\Support\Facades\Redis::class, 219 | 'Request' => Illuminate\Support\Facades\Request::class, 220 | 'Response' => Illuminate\Support\Facades\Response::class, 221 | 'Route' => Illuminate\Support\Facades\Route::class, 222 | 'Schema' => Illuminate\Support\Facades\Schema::class, 223 | 'Session' => Illuminate\Support\Facades\Session::class, 224 | 'Storage' => Illuminate\Support\Facades\Storage::class, 225 | 'Str' => Illuminate\Support\Str::class, 226 | 'URL' => Illuminate\Support\Facades\URL::class, 227 | 'Validator' => Illuminate\Support\Facades\Validator::class, 228 | 'View' => Illuminate\Support\Facades\View::class, 229 | 230 | ], 231 | 232 | ]; 233 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\Models\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | 'throttle' => 60, 101 | ], 102 | ], 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Password Confirmation Timeout 107 | |-------------------------------------------------------------------------- 108 | | 109 | | Here you may define the amount of seconds before a password confirmation 110 | | times out and the user is prompted to re-enter their password via the 111 | | confirmation screen. By default, the timeout lasts for three hours. 112 | | 113 | */ 114 | 115 | 'password_timeout' => 10800, 116 | 117 | ]; 118 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'ably' => [ 45 | 'driver' => 'ably', 46 | 'key' => env('ABLY_KEY'), 47 | ], 48 | 49 | 'redis' => [ 50 | 'driver' => 'redis', 51 | 'connection' => 'default', 52 | ], 53 | 54 | 'log' => [ 55 | 'driver' => 'log', 56 | ], 57 | 58 | 'null' => [ 59 | 'driver' => 'null', 60 | ], 61 | 62 | ], 63 | 64 | ]; 65 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | ], 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Cache Key Prefix 96 | |-------------------------------------------------------------------------- 97 | | 98 | | When utilizing a RAM based store such as APC or Memcached, there might 99 | | be other applications utilizing the same cache. So, we'll specify a 100 | | value to get prefixed to all our keys so we can avoid collisions. 101 | | 102 | */ 103 | 104 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 105 | 106 | ]; 107 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'schema' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | ], 93 | 94 | ], 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Migration Repository Table 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This table keeps track of all the migrations that have already run for 102 | | your application. Using this information, we can determine which of 103 | | the migrations on disk haven't actually been run in the database. 104 | | 105 | */ 106 | 107 | 'migrations' => 'migrations', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Redis Databases 112 | |-------------------------------------------------------------------------- 113 | | 114 | | Redis is an open source, fast, and advanced key-value store that also 115 | | provides a richer body of commands than a typical key-value system 116 | | such as APC or Memcached. Laravel makes it easy to dig right in. 117 | | 118 | */ 119 | 120 | 'redis' => [ 121 | 122 | 'client' => env('REDIS_CLIENT', 'phpredis'), 123 | 124 | 'options' => [ 125 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 127 | ], 128 | 129 | 'default' => [ 130 | 'url' => env('REDIS_URL'), 131 | 'host' => env('REDIS_HOST', '127.0.0.1'), 132 | 'password' => env('REDIS_PASSWORD', null), 133 | 'port' => env('REDIS_PORT', '6379'), 134 | 'database' => env('REDIS_DB', '0'), 135 | ], 136 | 137 | 'cache' => [ 138 | 'url' => env('REDIS_URL'), 139 | 'host' => env('REDIS_HOST', '127.0.0.1'), 140 | 'password' => env('REDIS_PASSWORD', null), 141 | 'port' => env('REDIS_PORT', '6379'), 142 | 'database' => env('REDIS_CACHE_DB', '1'), 143 | ], 144 | 145 | ], 146 | 147 | ]; 148 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been setup for each driver as an example of the required options. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | ], 37 | 38 | 'public' => [ 39 | 'driver' => 'local', 40 | 'root' => storage_path('app/public'), 41 | 'url' => env('APP_URL').'/storage', 42 | 'visibility' => 'public', 43 | ], 44 | 45 | 's3' => [ 46 | 'driver' => 's3', 47 | 'key' => env('AWS_ACCESS_KEY_ID'), 48 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 49 | 'region' => env('AWS_DEFAULT_REGION'), 50 | 'bucket' => env('AWS_BUCKET'), 51 | 'url' => env('AWS_URL'), 52 | 'endpoint' => env('AWS_ENDPOINT'), 53 | ], 54 | 55 | ], 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Symbolic Links 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may configure the symbolic links that will be created when the 63 | | `storage:link` Artisan command is executed. The array keys should be 64 | | the locations of the links and the values should be their targets. 65 | | 66 | */ 67 | 68 | 'links' => [ 69 | public_path('storage') => storage_path('app/public'), 70 | ], 71 | 72 | ]; 73 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Log Channels 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you may configure the log channels for your application. Out of 28 | | the box, Laravel uses the Monolog PHP logging library. This gives 29 | | you a variety of powerful log handlers / formatters to utilize. 30 | | 31 | | Available Drivers: "single", "daily", "slack", "syslog", 32 | | "errorlog", "monolog", 33 | | "custom", "stack" 34 | | 35 | */ 36 | 37 | 'channels' => [ 38 | 'stack' => [ 39 | 'driver' => 'stack', 40 | 'channels' => ['single'], 41 | 'ignore_exceptions' => false, 42 | ], 43 | 44 | 'single' => [ 45 | 'driver' => 'single', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => env('LOG_LEVEL', 'debug'), 48 | ], 49 | 50 | 'daily' => [ 51 | 'driver' => 'daily', 52 | 'path' => storage_path('logs/laravel.log'), 53 | 'level' => env('LOG_LEVEL', 'debug'), 54 | 'days' => 14, 55 | ], 56 | 57 | 'slack' => [ 58 | 'driver' => 'slack', 59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 60 | 'username' => 'Laravel Log', 61 | 'emoji' => ':boom:', 62 | 'level' => env('LOG_LEVEL', 'critical'), 63 | ], 64 | 65 | 'papertrail' => [ 66 | 'driver' => 'monolog', 67 | 'level' => env('LOG_LEVEL', 'debug'), 68 | 'handler' => SyslogUdpHandler::class, 69 | 'handler_with' => [ 70 | 'host' => env('PAPERTRAIL_URL'), 71 | 'port' => env('PAPERTRAIL_PORT'), 72 | ], 73 | ], 74 | 75 | 'stderr' => [ 76 | 'driver' => 'monolog', 77 | 'handler' => StreamHandler::class, 78 | 'formatter' => env('LOG_STDERR_FORMATTER'), 79 | 'with' => [ 80 | 'stream' => 'php://stderr', 81 | ], 82 | ], 83 | 84 | 'syslog' => [ 85 | 'driver' => 'syslog', 86 | 'level' => env('LOG_LEVEL', 'debug'), 87 | ], 88 | 89 | 'errorlog' => [ 90 | 'driver' => 'errorlog', 91 | 'level' => env('LOG_LEVEL', 'debug'), 92 | ], 93 | 94 | 'null' => [ 95 | 'driver' => 'monolog', 96 | 'handler' => NullHandler::class, 97 | ], 98 | 99 | 'emergency' => [ 100 | 'path' => storage_path('logs/laravel.log'), 101 | ], 102 | ], 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'auth_mode' => null, 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => '/usr/sbin/sendmail -bs', 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Global "From" Address 78 | |-------------------------------------------------------------------------- 79 | | 80 | | You may wish for all e-mails sent by your application to be sent from 81 | | the same address. Here, you may specify a name and address that is 82 | | used globally for all e-mails that are sent by your application. 83 | | 84 | */ 85 | 86 | 'from' => [ 87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 88 | 'name' => env('MAIL_FROM_NAME', 'Example'), 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Markdown Mail Settings 94 | |-------------------------------------------------------------------------- 95 | | 96 | | If you are using Markdown based email rendering, you may configure your 97 | | theme and component paths here, allowing you to customize the design 98 | | of the emails. Or, you may simply stick with the Laravel defaults! 99 | | 100 | */ 101 | 102 | 'markdown' => [ 103 | 'theme' => 'default', 104 | 105 | 'paths' => [ 106 | resource_path('views/vendor/mail'), 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /config/octane.php: -------------------------------------------------------------------------------- 1 | env('OCTANE_SERVER', 'roadrunner'), 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Force HTTPS 40 | |-------------------------------------------------------------------------- 41 | | 42 | | When this configuration value is set to "true", Octane will inform the 43 | | framework that all absolute links must be generated using the HTTPS 44 | | protocol. Otherwise your links may be generated using plain HTTP. 45 | | 46 | */ 47 | 48 | 'https' => env('OCTANE_HTTPS', false), 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | Octane Listeners 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All of the event listeners for Octane's events are defined below. These 56 | | listeners are responsible for resetting your application's state for 57 | | the next request. You may even add your own listeners to the list. 58 | | 59 | */ 60 | 61 | 'listeners' => [ 62 | WorkerStarting::class => [ 63 | EnsureUploadedFilesAreValid::class, 64 | ], 65 | 66 | RequestReceived::class => [ 67 | ...Octane::prepareApplicationForNextOperation(), 68 | ...Octane::prepareApplicationForNextRequest(), 69 | // 70 | ], 71 | 72 | RequestHandled::class => [ 73 | // 74 | ], 75 | 76 | RequestTerminated::class => [ 77 | // 78 | ], 79 | 80 | TaskReceived::class => [ 81 | ...Octane::prepareApplicationForNextOperation(), 82 | // 83 | ], 84 | 85 | TickReceived::class => [ 86 | ...Octane::prepareApplicationForNextOperation(), 87 | // 88 | ], 89 | 90 | OperationTerminated::class => [ 91 | FlushTemporaryContainerInstances::class, 92 | // DisconnectFromDatabases::class, 93 | // CollectGarbage::class, 94 | ], 95 | 96 | WorkerErrorOccurred::class => [ 97 | ReportException::class, 98 | StopWorkerIfNecessary::class, 99 | ], 100 | 101 | WorkerStopping::class => [ 102 | // 103 | ], 104 | ], 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Warm / Flush Bindings 109 | |-------------------------------------------------------------------------- 110 | | 111 | | The bindings listed below will either be pre-warmed when a worker boots 112 | | or they will be flushed before every new request. Flushing a binding 113 | | will force the container to resolve that binding again when asked. 114 | | 115 | */ 116 | 117 | 'warm' => [ 118 | ...Octane::defaultServicesToWarm(), 119 | ], 120 | 121 | 'flush' => [ 122 | // 123 | ], 124 | 125 | /* 126 | |-------------------------------------------------------------------------- 127 | | Octane Cache Table 128 | |-------------------------------------------------------------------------- 129 | | 130 | | While using Swoole, you may leverage the Octane cache, which is powered 131 | | by a Swoole table. You may set the maximum number of rows as well as 132 | | the number of bytes per row using the configuration options below. 133 | | 134 | */ 135 | 136 | 'cache' => [ 137 | 'rows' => 1000, 138 | 'bytes' => 10000, 139 | ], 140 | 141 | /* 142 | |-------------------------------------------------------------------------- 143 | | Octane Swoole Tables 144 | |-------------------------------------------------------------------------- 145 | | 146 | | While using Swoole, you may define additional tables as required by the 147 | | application. These tables can be used to store data that needs to be 148 | | quickly accessed by other workers on the particular Swoole server. 149 | | 150 | */ 151 | 152 | 'tables' => [ 153 | 'example:1000' => [ 154 | 'name' => 'string:1000', 155 | 'votes' => 'int', 156 | ], 157 | ], 158 | 159 | /* 160 | |-------------------------------------------------------------------------- 161 | | File Watching 162 | |-------------------------------------------------------------------------- 163 | | 164 | | The following list of files and directories will be watched when using 165 | | the --watch option offered by Octane. If any of the directories and 166 | | files are changed, Octane will automatically reload your workers. 167 | | 168 | */ 169 | 170 | 'watch' => [ 171 | 'app', 172 | 'bootstrap', 173 | 'config', 174 | 'database', 175 | 'public', 176 | 'resources', 177 | 'routes', 178 | 'composer.lock', 179 | '.env', 180 | ], 181 | 182 | /* 183 | |-------------------------------------------------------------------------- 184 | | Garbage Collection Threshold 185 | |-------------------------------------------------------------------------- 186 | | 187 | | When executing long-lived PHP scripts such as Octane, memory can build 188 | | up before being cleared by PHP. You can force Octane to run garbage 189 | | collection if your application consumes this amount of megabytes. 190 | | 191 | */ 192 | 193 | 'garbage' => 50, 194 | 195 | /* 196 | |-------------------------------------------------------------------------- 197 | | Maximum Execution Time 198 | |-------------------------------------------------------------------------- 199 | | 200 | | The following setting configures the maximum execution time for requests 201 | | being handled by Octane. You may set this value to 0 to indicate that 202 | | there isn't a specific time limit on Octane request execution time. 203 | | 204 | */ 205 | 206 | 'max_execution_time' => 30, 207 | 208 | /* 209 | |-------------------------------------------------------------------------- 210 | | State File Location 211 | |-------------------------------------------------------------------------- 212 | | 213 | | The state file tracks the current workers details. You might want 214 | | to change the location here. 215 | | 216 | */ 217 | 218 | 'state_file' => storage_path('logs/octane-server-state.json'), 219 | 220 | ]; 221 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'suffix' => env('SQS_SUFFIX'), 59 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 60 | ], 61 | 62 | 'redis' => [ 63 | 'driver' => 'redis', 64 | 'connection' => 'default', 65 | 'queue' => env('REDIS_QUEUE', 'default'), 66 | 'retry_after' => 90, 67 | 'block_for' => null, 68 | ], 69 | 70 | ], 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Failed Queue Jobs 75 | |-------------------------------------------------------------------------- 76 | | 77 | | These options configure the behavior of failed queue job logging so you 78 | | can control which database and table are used to store the jobs that 79 | | have failed. You may change them to any database / table you wish. 80 | | 81 | */ 82 | 83 | 'failed' => [ 84 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 85 | 'database' => env('DB_CONNECTION', 'mysql'), 86 | 'table' => 'failed_jobs', 87 | ], 88 | 89 | ]; 90 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION', null), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | While using one of the framework's cache driven session backends you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE', null), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Session Sweeping Lottery 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Some session drivers must manually sweep their storage location to get 111 | | rid of old sessions from storage. Here are the chances that it will 112 | | happen on a given request. By default, the odds are 2 out of 100. 113 | | 114 | */ 115 | 116 | 'lottery' => [2, 100], 117 | 118 | /* 119 | |-------------------------------------------------------------------------- 120 | | Session Cookie Name 121 | |-------------------------------------------------------------------------- 122 | | 123 | | Here you may change the name of the cookie used to identify a session 124 | | instance by ID. The name specified here will get used every time a 125 | | new session cookie is created by the framework for every driver. 126 | | 127 | */ 128 | 129 | 'cookie' => env( 130 | 'SESSION_COOKIE', 131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Session Cookie Path 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The session cookie path determines the path for which the cookie will 140 | | be regarded as available. Typically, this will be the root path of 141 | | your application but you are free to change this when necessary. 142 | | 143 | */ 144 | 145 | 'path' => '/', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Session Cookie Domain 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Here you may change the domain of the cookie used to identify a session 153 | | in your application. This will determine which domains the cookie is 154 | | available to in your application. A sensible default has been set. 155 | | 156 | */ 157 | 158 | 'domain' => env('SESSION_DOMAIN', null), 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | HTTPS Only Cookies 163 | |-------------------------------------------------------------------------- 164 | | 165 | | By setting this option to true, session cookies will only be sent back 166 | | to the server if the browser has a HTTPS connection. This will keep 167 | | the cookie from being sent to you if it can not be done securely. 168 | | 169 | */ 170 | 171 | 'secure' => env('SESSION_SECURE_COOKIE'), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | HTTP Access Only 176 | |-------------------------------------------------------------------------- 177 | | 178 | | Setting this value to true will prevent JavaScript from accessing the 179 | | value of the cookie and the cookie will only be accessible through 180 | | the HTTP protocol. You are free to modify this option if needed. 181 | | 182 | */ 183 | 184 | 'http_only' => true, 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Same-Site Cookies 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This option determines how your cookies behave when cross-site requests 192 | | take place, and can be used to mitigate CSRF attacks. By default, we 193 | | will set this value to "lax" since this is a secure default value. 194 | | 195 | | Supported: "lax", "strict", "none", null 196 | | 197 | */ 198 | 199 | 'same_site' => 'lax', 200 | 201 | ]; 202 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->name, 27 | 'email' => $this->faker->unique()->safeEmail, 28 | 'email_verified_at' => now(), 29 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 30 | 'remember_token' => Str::random(10), 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # We don't install the packages at runtime. This is done when building the Docker image. 4 | # The reason behind this is to be able to serve the container as fast as possible, 5 | # without adding overhead to the scaling process. 6 | 7 | # This file is only for small minor fixes on the project, like deploying the files to the CDN, 8 | # caching the config, route, view, running migrations, etc. 9 | 10 | # composer install --ignore-platform-reqs --optimize-autoloader --no-dev --prefer-dist 11 | 12 | php artisan config:cache 13 | php artisan route:cache 14 | php artisan view:cache 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "mix", 6 | "watch": "mix watch", 7 | "watch-poll": "mix watch -- --watch-options-poll=1000", 8 | "hot": "mix watch --hot", 9 | "prod": "npm run production", 10 | "production": "mix --production" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.21", 14 | "laravel-mix": "^6.0.6", 15 | "lodash": "^4.17.19", 16 | "postcss": "^8.1.14" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renoki-co/laravel-helm-demo/95aabc6762d974ee678d589cd9c64d7ea76679c3/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = tap($kernel->handle( 52 | $request = Request::capture() 53 | ))->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renoki-co/laravel-helm-demo/95aabc6762d974ee678d589cd9c64d7ea76679c3/resources/css/app.css -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // forceTLS: true 28 | // }); 29 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_equals' => 'The :attribute must be a date equal to :date.', 36 | 'date_format' => 'The :attribute does not match the format :format.', 37 | 'different' => 'The :attribute and :other must be different.', 38 | 'digits' => 'The :attribute must be :digits digits.', 39 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 40 | 'dimensions' => 'The :attribute has invalid image dimensions.', 41 | 'distinct' => 'The :attribute field has a duplicate value.', 42 | 'email' => 'The :attribute must be a valid email address.', 43 | 'ends_with' => 'The :attribute must end with one of the following: :values.', 44 | 'exists' => 'The selected :attribute is invalid.', 45 | 'file' => 'The :attribute must be a file.', 46 | 'filled' => 'The :attribute field must have a value.', 47 | 'gt' => [ 48 | 'numeric' => 'The :attribute must be greater than :value.', 49 | 'file' => 'The :attribute must be greater than :value kilobytes.', 50 | 'string' => 'The :attribute must be greater than :value characters.', 51 | 'array' => 'The :attribute must have more than :value items.', 52 | ], 53 | 'gte' => [ 54 | 'numeric' => 'The :attribute must be greater than or equal :value.', 55 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.', 56 | 'string' => 'The :attribute must be greater than or equal :value characters.', 57 | 'array' => 'The :attribute must have :value items or more.', 58 | ], 59 | 'image' => 'The :attribute must be an image.', 60 | 'in' => 'The selected :attribute is invalid.', 61 | 'in_array' => 'The :attribute field does not exist in :other.', 62 | 'integer' => 'The :attribute must be an integer.', 63 | 'ip' => 'The :attribute must be a valid IP address.', 64 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 65 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 66 | 'json' => 'The :attribute must be a valid JSON string.', 67 | 'lt' => [ 68 | 'numeric' => 'The :attribute must be less than :value.', 69 | 'file' => 'The :attribute must be less than :value kilobytes.', 70 | 'string' => 'The :attribute must be less than :value characters.', 71 | 'array' => 'The :attribute must have less than :value items.', 72 | ], 73 | 'lte' => [ 74 | 'numeric' => 'The :attribute must be less than or equal :value.', 75 | 'file' => 'The :attribute must be less than or equal :value kilobytes.', 76 | 'string' => 'The :attribute must be less than or equal :value characters.', 77 | 'array' => 'The :attribute must not have more than :value items.', 78 | ], 79 | 'max' => [ 80 | 'numeric' => 'The :attribute may not be greater than :max.', 81 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 82 | 'string' => 'The :attribute may not be greater than :max characters.', 83 | 'array' => 'The :attribute may not have more than :max items.', 84 | ], 85 | 'mimes' => 'The :attribute must be a file of type: :values.', 86 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 87 | 'min' => [ 88 | 'numeric' => 'The :attribute must be at least :min.', 89 | 'file' => 'The :attribute must be at least :min kilobytes.', 90 | 'string' => 'The :attribute must be at least :min characters.', 91 | 'array' => 'The :attribute must have at least :min items.', 92 | ], 93 | 'multiple_of' => 'The :attribute must be a multiple of :value.', 94 | 'not_in' => 'The selected :attribute is invalid.', 95 | 'not_regex' => 'The :attribute format is invalid.', 96 | 'numeric' => 'The :attribute must be a number.', 97 | 'password' => 'The password is incorrect.', 98 | 'present' => 'The :attribute field must be present.', 99 | 'regex' => 'The :attribute format is invalid.', 100 | 'required' => 'The :attribute field is required.', 101 | 'required_if' => 'The :attribute field is required when :other is :value.', 102 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 103 | 'required_with' => 'The :attribute field is required when :values is present.', 104 | 'required_with_all' => 'The :attribute field is required when :values are present.', 105 | 'required_without' => 'The :attribute field is required when :values is not present.', 106 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 107 | 'same' => 'The :attribute and :other must match.', 108 | 'size' => [ 109 | 'numeric' => 'The :attribute must be :size.', 110 | 'file' => 'The :attribute must be :size kilobytes.', 111 | 'string' => 'The :attribute must be :size characters.', 112 | 'array' => 'The :attribute must contain :size items.', 113 | ], 114 | 'starts_with' => 'The :attribute must start with one of the following: :values.', 115 | 'string' => 'The :attribute must be a string.', 116 | 'timezone' => 'The :attribute must be a valid zone.', 117 | 'unique' => 'The :attribute has already been taken.', 118 | 'uploaded' => 'The :attribute failed to upload.', 119 | 'url' => 'The :attribute format is invalid.', 120 | 'uuid' => 'The :attribute must be a valid UUID.', 121 | 122 | /* 123 | |-------------------------------------------------------------------------- 124 | | Custom Validation Language Lines 125 | |-------------------------------------------------------------------------- 126 | | 127 | | Here you may specify custom validation messages for attributes using the 128 | | convention "attribute.rule" to name the lines. This makes it quick to 129 | | specify a specific custom language line for a given attribute rule. 130 | | 131 | */ 132 | 133 | 'custom' => [ 134 | 'attribute-name' => [ 135 | 'rule-name' => 'custom-message', 136 | ], 137 | ], 138 | 139 | /* 140 | |-------------------------------------------------------------------------- 141 | | Custom Validation Attributes 142 | |-------------------------------------------------------------------------- 143 | | 144 | | The following language lines are used to swap our attribute placeholder 145 | | with something more reader friendly such as "E-Mail Address" instead 146 | | of "email". This simply helps us make our message more expressive. 147 | | 148 | */ 149 | 150 | 'attributes' => [], 151 | 152 | ]; 153 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 22 | 23 | 24 |
25 | @if (Route::has('login')) 26 | 37 | @endif 38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 |
49 |
50 |
51 |
52 | 53 | 54 |
55 | 56 |
57 |
58 | Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end. 59 |
60 |
61 |
62 | 63 |
64 |
65 | 66 | 67 |
68 | 69 |
70 |
71 | Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process. 72 |
73 |
74 |
75 | 76 |
77 |
78 | 79 | 80 |
81 | 82 |
83 |
84 | Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials. 85 |
86 |
87 |
88 | 89 |
90 |
91 | 92 |
Vibrant Ecosystem
93 |
94 | 95 |
96 |
97 | Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more. 98 |
99 |
100 |
101 |
102 |
103 | 104 |
105 |
106 |
107 | 108 | 109 | 110 | 111 | 112 | Shop 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | Sponsor 121 | 122 |
123 |
124 | 125 |
126 | Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) 127 | 128 | @if ($podName) 129 |
130 | Pod name: {{ $podName }} 131 | @endif 132 |
133 |
134 |
135 |
136 | 137 | 138 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | $_ENV['POD_NAME'] ?? ($_SERVER['POD_NAME'] ?? null), 19 | ]); 20 | }); 21 | 22 | Route::get('/health', [\App\Http\Controllers\HealthController::class, 'handle']); 23 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel applications. By default, we are compiling the CSS 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .postCss('resources/css/app.css', 'public/css', [ 16 | // 17 | ]); 18 | --------------------------------------------------------------------------------