From 21339f08f4bbb8609f3a58ad8a48ab40ecdbbed0 Mon Sep 17 00:00:00 2001 From: James King Date: Mon, 24 Mar 2025 12:01:32 +0000 Subject: [PATCH 1/8] Update fork information --- .github/FUNDING.yml | 2 -- .github/SECURITY.md | 2 +- LICENSE.md | 1 + README.md | 25 +++++++++++++------------ composer.json | 6 +++++- 5 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1627ed1..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -ko_fi: ivanvermeyen -custom: https://paypal.me/ivanvermeyen diff --git a/.github/SECURITY.md b/.github/SECURITY.md index b0a92f1..2698525 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -1,3 +1,3 @@ # Security Policy -If you discover any security related issues, please email ivan@codezero.be instead of using the issue tracker. +If you discover any security related issues, please email james@jamesking.dev instead of using the issue tracker. diff --git a/LICENSE.md b/LICENSE.md index b52fbf6..2677db6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,7 @@ # The MIT License (MIT) Copyright (c) 2017 Ivan Vermeyen () +Copyright (c) 2025 James King () > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index bcaf7d8..c2d674f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Laravel StageFront -[![GitHub release](https://img.shields.io/github/release/codezero-be/laravel-stagefront.svg?style=flat-square)](https://github.com/codezero-be/laravel-stagefront/releases) +[![GitHub release](https://img.shields.io/github/release/jamesking56/laravel-stagefront.svg?style=flat-square)](https://github.com/jamesking56/laravel-stagefront/releases) [![Laravel](https://img.shields.io/badge/laravel-11-red?style=flat-square&logo=laravel&logoColor=white)](https://laravel.com) -[![License](https://img.shields.io/packagist/l/codezero/laravel-stagefront.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/github/actions/workflow/status/codezero-be/laravel-stagefront/run-tests.yml?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/codezero-be/laravel-stagefront/actions) -[![Code Quality](https://img.shields.io/codacy/grade/a5db8a1321664e67900c96eadc575ece/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/laravel-stagefront) -[![Total Downloads](https://img.shields.io/packagist/dt/codezero/laravel-stagefront.svg?style=flat-square)](https://packagist.org/packages/codezero/laravel-stagefront) +[![License](https://img.shields.io/packagist/l/jamesking56/laravel-stagefront.svg?style=flat-square)](LICENSE.md) +[![Build Status](https://img.shields.io/github/actions/workflow/status/jamesking56/laravel-stagefront/run-tests.yml?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/jamesking56/laravel-stagefront/actions) +[![Code Quality](https://img.shields.io/codacy/grade/a5db8a1321664e67900c96eadc575ece/master?style=flat-square)](https://app.codacy.com/gh/jamesking56/laravel-stagefront) +[![Total Downloads](https://img.shields.io/packagist/dt/jamesking56/laravel-stagefront.svg?style=flat-square)](https://packagist.org/packages/codezero/laravel-stagefront) -[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R3UQ8V) +### RIP Ivan Vermeyen: thank you for your fantastic work #### Quickly add password protection to a staging site. @@ -29,9 +29,9 @@ By installing StageFront with composer, adding the middleware and setting 3 vari #### ☑️ Require the package via Composer: ```bash -composer require codezero/laravel-stagefront +composer require jamesking56/laravel-stagefront ``` -Laravel will automatically register the [ServiceProvider](https://github.com/codezero-be/laravel-stagefront/blob/master/src/StageFrontServiceProvider.php) and routes. +Laravel will automatically register the [ServiceProvider](https://github.com/jamesking56/laravel-stagefront/blob/master/src/StageFrontServiceProvider.php) and routes. When StageFront is disabled, its routes will not be registered. @@ -65,7 +65,7 @@ Now you just need to set some `.env` variables and you are up and running! Set some options in your `.env` file or publish the [configuration file](#-publish-configuration-file). -See an [example .env file](https://github.com/codezero-be/laravel-stagefront/blob/master/.env.example). +See an [example .env file](https://github.com/jamesking56/laravel-stagefront/blob/master/.env.example). Enable StageFront and choose a login and password: @@ -266,17 +266,18 @@ composer test ## ☕️ Credits -- [Ivan Vermeyen](https://byterider.io/) +- [Ivan Vermeyen (RIP)](https://byterider.io/) +- [James King](https://jamesking.dev/) - [All contributors](../../contributors) ## 🔓 Security -If you discover any security related issues, please [e-mail me](mailto:ivan@codezero.be) instead of using the issue tracker. +If you discover any security related issues, please [e-mail me](mailto:james@jamesking.dev) instead of using the issue tracker. ## 📑 Changelog A complete list of all notable changes to this package can be found on the -[releases page](https://github.com/codezero-be/laravel-stagefront/releases). +[releases page](https://github.com/jamesking56/laravel-stagefront/releases). ## 📜 License diff --git a/composer.json b/composer.json index 17c10eb..591d21f 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "codezero/laravel-stagefront", + "name": "jamesking56/laravel-stagefront", "description": "Quickly add some password protection to a staging site.", "keywords": [ "laravel", @@ -12,6 +12,10 @@ { "name": "Ivan Vermeyen", "email": "ivan@codezero.be" + }, + { + "name": "James King", + "email": "james@jamesking.dev" } ], "require": { From 51dce7b66eb95d85425c9b1e23d7a2199ac3850d Mon Sep 17 00:00:00 2001 From: James King Date: Mon, 24 Mar 2025 12:12:32 +0000 Subject: [PATCH 2/8] Update third-party actions versions --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d7b0425..acb926e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -64,10 +64,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} From 5cd4143c62a7571d7da29c619e902856ccf96b96 Mon Sep 17 00:00:00 2001 From: James King Date: Thu, 27 Mar 2025 00:15:20 +0000 Subject: [PATCH 3/8] Laravel 12.x Compatibility --- .github/workflows/run-tests.yml | 12 +++++++++++- composer.json | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index acb926e..e931c0d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: php: [ 8.0, 8.1, 8.2, 8.3 ] - laravel: [ 8.*, 9.*, 10.*, 11.* ] + laravel: [ 8.*, 9.*, 10.*, 11.*, 12.* ] dependency-version: [ prefer-stable ] include: - laravel: 5.7.* @@ -52,6 +52,12 @@ jobs: - laravel: 11.* php: 8.3 testbench: 9.* + - laravel: 12.* + php: 8.2 + testbench: 10.* + - laravel: 12.* + php: 8.3 + testbench: 10.* exclude: - laravel: 10.* php: 8.0 @@ -59,6 +65,10 @@ jobs: php: 8.0 - laravel: 11.* php: 8.1 + - laravel: 12.* + php: 8.0 + - laravel: 12.* + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/composer.json b/composer.json index 591d21f..c6fde45 100644 --- a/composer.json +++ b/composer.json @@ -21,11 +21,11 @@ "require": { "php": "^7.1|^8.0", "codezero/dotenv-updater": "^1.1|^2.0", - "illuminate/support": "^5.7|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0" + "illuminate/support": "^5.7|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0" }, "require-dev": { - "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0" + "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0|^11.5.3" }, "scripts": { "test": "phpunit" From 59494b7ef3c08a54a328477a737da54c60e3eb46 Mon Sep 17 00:00:00 2001 From: James King Date: Thu, 27 Mar 2025 00:20:02 +0000 Subject: [PATCH 4/8] PHP 8.4 Compatibility Updates our test workflow to ensure we are covering PHP 8.4 support for Laravel 10, 11 and 12 --- .github/workflows/run-tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e931c0d..c57c327 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -46,18 +46,27 @@ jobs: - laravel: 10.* php: 8.3 testbench: 8.* + - laravel: 10.* + php: 8.4 + testbench: 8.* - laravel: 11.* php: 8.2 testbench: 9.* - laravel: 11.* php: 8.3 testbench: 9.* + - laravel: 11.* + php: 8.4 + testbench: 9.* - laravel: 12.* php: 8.2 testbench: 10.* - laravel: 12.* php: 8.3 testbench: 10.* + - laravel: 12.* + php: 8.4 + testbench: 10.* exclude: - laravel: 10.* php: 8.0 From 6fa1c19f2425028a969b73bb267da3078f846d5b Mon Sep 17 00:00:00 2001 From: James King Date: Thu, 27 Mar 2025 00:32:02 +0000 Subject: [PATCH 5/8] Drop support for EOL Laravel and PHP versions --- .github/workflows/run-tests.yml | 52 ++------------------------------- README.md | 34 +++++++-------------- composer.json | 8 ++--- 3 files changed, 17 insertions(+), 77 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c57c327..7029177 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,47 +8,10 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.0, 8.1, 8.2, 8.3 ] - laravel: [ 8.*, 9.*, 10.*, 11.*, 12.* ] + php: [ 8.2, 8.3, 8.4 ] + laravel: [ 11.*, 12.* ] dependency-version: [ prefer-stable ] include: - - laravel: 5.7.* - php: 7.2 - testbench: 3.7.* - - laravel: 5.8.* - php: 7.2 - testbench: 3.8.* - - laravel: 6.* - php: 7.2 - testbench: 4.* - - laravel: 6.* - php: 8.0 - testbench: 4.* - - laravel: 7.* - php: 7.2 - testbench: 5.* - - laravel: 7.* - php: 8.0 - testbench: 5.* - - laravel: 8.* - php: 7.3 - testbench: 6.* - - laravel: 8.* - testbench: 6.* - - laravel: 9.* - testbench: 7.* - - laravel: 10.* - php: 8.1 - testbench: 8.* - - laravel: 10.* - php: 8.2 - testbench: 8.* - - laravel: 10.* - php: 8.3 - testbench: 8.* - - laravel: 10.* - php: 8.4 - testbench: 8.* - laravel: 11.* php: 8.2 testbench: 9.* @@ -67,17 +30,6 @@ jobs: - laravel: 12.* php: 8.4 testbench: 10.* - exclude: - - laravel: 10.* - php: 8.0 - - laravel: 11.* - php: 8.0 - - laravel: 11.* - php: 8.1 - - laravel: 12.* - php: 8.0 - - laravel: 12.* - php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/README.md b/README.md index c2d674f..5fe073c 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ By installing StageFront with composer, adding the middleware and setting 3 vari ## ✅ Requirements -- PHP ^7.1 | ^8.0 -- [Laravel](https://laravel.com/) >= 5.7 +- PHP ^8.2 +- [Laravel](https://laravel.com/) >= 11 ## 📦 Installation @@ -37,19 +37,7 @@ When StageFront is disabled, its routes will not be registered. #### ☑️ Install Middleware -To activate the middleware, add it to the `web` middleware group in `app/Http/Kernel.php`, **right after the `StartSession` middleware**: - -```php -protected $middlewareGroups = [ - 'web' => [ - \Illuminate\Session\Middleware\StartSession::class, // <= after this - \CodeZero\StageFront\Middleware\RedirectIfStageFrontIsEnabled::class, - //... - ], -]; -``` - -In Laravel 6+ you need to add the middleware to the `$middlewarePriority` array in `app/Http/Kernel.php`, **right after the `StartSession` middleware**. +To activate the middleware, you need to add the middleware to the `$middlewarePriority` array in `app/Http/Kernel.php`, **right after the `StartSession` middleware**. ```php protected $middlewarePriority = [ @@ -76,7 +64,7 @@ Enable StageFront and choose a login and password: | `STAGEFRONT_PASSWORD` | `string` | `stagefront` | | `STAGEFRONT_ENCRYPTED` | `bool` | `false` | -By default StageFront is disabled and uses a plain text password when it's enabled. If you set `STAGEFRONT_ENCRYPTED` to `true` the password should be a hashed value. You can generate this using Laravel's `\Hash::make('your password')` function. +By default, StageFront is disabled and uses a plain text password when it's enabled. If you set `STAGEFRONT_ENCRYPTED` to `true` the password should be a hashed value. You can generate this using Laravel's `\Hash::make('your password')` function. ##### Artisan Commands for Quick Setup @@ -113,13 +101,13 @@ The above login and password settings will then be ignored. | `STAGEFRONT_DATABASE_PASSWORD_FIELD` | `string` | `password` | If you want to grant access to just a few of those users, you can whitelist them by setting `STAGEFRONT_DATABASE_WHITELIST` to a comma separated string: `'john@doe.io,jane@doe.io'`. -In the config file itself you can also use an array of e-mail addresses. +In the config file itself, you can also use an array of e-mail addresses. -By default the `users` table is used with the `email` and `password` field names. But you can change this if you are using some other table or fields. +By default, the `users` table is used with the `email` and `password` field names. But you can change this if you are using some other table or fields. ## 🔖 IP Whitelist -You can add a comma separated list of IP's to grant these users easier or exclusive access to your staging site. +You can add a comma-separated list of IP's to grant these users easier or exclusive access to your staging site. For example: `'1.2.3.4,1.2.3.4'`. In the config file itself you can also use an array of IP's. | Option | Type | Default | @@ -141,7 +129,7 @@ Set `STAGEFRONT_IP_WHITELIST_REQUIRE_LOGIN` to `true` to set this up. #### ☑️ Change Route URL -By default a `GET` and `POST` route will be registered with the `/stagefront` URL. +By default, a `GET` and `POST` route will be registered with the `/stagefront` URL. You can change the URL by setting this option: @@ -193,14 +181,14 @@ For example: 'ignore_urls' => [ // ignores /john, but noting under /john '/john', - // ignores everyting under /jane, but not /jane itself + // ignores everything under /jane, but not /jane itself '/jane/*', ], ``` #### ☑️ Ignore Domains -If for any reason you wish to disable StageFront on specific doamins, you can add these to the `ignore_udomains` array in the [configuration file](#-publish-configuration-file). You can't set this in the `.env` file. +If for any reason you wish to disable StageFront on specific domains, you can add these to the `ignore_domains` array in the [configuration file](#-publish-configuration-file). You can't set this in the `.env` file. For example: @@ -272,7 +260,7 @@ composer test ## 🔓 Security -If you discover any security related issues, please [e-mail me](mailto:james@jamesking.dev) instead of using the issue tracker. +If you discover any security-related issues, please [e-mail me](mailto:james@jamesking.dev) instead of using the issue tracker. ## 📑 Changelog diff --git a/composer.json b/composer.json index c6fde45..873a2f4 100644 --- a/composer.json +++ b/composer.json @@ -19,13 +19,13 @@ } ], "require": { - "php": "^7.1|^8.0", + "php": "^8.2", "codezero/dotenv-updater": "^1.1|^2.0", - "illuminate/support": "^5.7|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0" + "illuminate/support": "^11.0|^12.0" }, "require-dev": { - "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0|^11.5.3" + "orchestra/testbench": "^9.0|^10.0", + "phpunit/phpunit": "^10.0|^11.5.3" }, "scripts": { "test": "phpunit" From f1e2b92e8287ffdcefa458e1ef2dae1a31a3ab49 Mon Sep 17 00:00:00 2001 From: James King Date: Thu, 27 Mar 2025 00:35:26 +0000 Subject: [PATCH 6/8] Only run workflow on PRs --- .github/workflows/run-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7029177..b25e261 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,7 @@ name: Tests -on: [ push, pull_request ] +on: + pull_request: jobs: test: From ac079b88cdd4e2fe7ed3c2ad8a4b99ae6b7fe89b Mon Sep 17 00:00:00 2001 From: James King Date: Wed, 6 May 2026 16:07:16 +0100 Subject: [PATCH 7/8] Set minimum PHP version to 8.4 --- .github/workflows/run-tests.yml | 32 ++++++++++---------------------- README.md | 2 +- composer.json | 2 +- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b25e261..640ca57 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,28 +9,16 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.2, 8.3, 8.4 ] - laravel: [ 11.*, 12.* ] - dependency-version: [ prefer-stable ] - include: - - laravel: 11.* - php: 8.2 - testbench: 9.* - - laravel: 11.* - php: 8.3 - testbench: 9.* - - laravel: 11.* - php: 8.4 - testbench: 9.* - - laravel: 12.* - php: 8.2 - testbench: 10.* - - laravel: 12.* - php: 8.3 - testbench: 10.* - - laravel: 12.* - php: 8.4 - testbench: 10.* + php: [ 8.4 ] + laravel: [ 11.*, 12.* ] + dependency-version: [ prefer-stable ] + include: + - laravel: 11.* + php: 8.4 + testbench: 9.* + - laravel: 12.* + php: 8.4 + testbench: 10.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/README.md b/README.md index 5fe073c..02cdfcd 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ By installing StageFront with composer, adding the middleware and setting 3 vari ## ✅ Requirements -- PHP ^8.2 +- PHP ^8.4 - [Laravel](https://laravel.com/) >= 11 ## 📦 Installation diff --git a/composer.json b/composer.json index 873a2f4..d509eff 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^8.2", + "php": "^8.4", "codezero/dotenv-updater": "^1.1|^2.0", "illuminate/support": "^11.0|^12.0" }, From 72dfabcc3e5dd45a291462541425de198f95000b Mon Sep 17 00:00:00 2001 From: James King Date: Wed, 6 May 2026 16:14:57 +0100 Subject: [PATCH 8/8] Add PHP 8.5 test coverage --- .github/workflows/run-tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 640ca57..cb29489 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,16 +9,22 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.4 ] + php: [ 8.4, 8.5 ] laravel: [ 11.*, 12.* ] dependency-version: [ prefer-stable ] include: - laravel: 11.* php: 8.4 testbench: 9.* + - laravel: 11.* + php: 8.5 + testbench: 9.* - laravel: 12.* php: 8.4 testbench: 10.* + - laravel: 12.* + php: 8.5 + testbench: 10.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}