Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -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.
74 changes: 20 additions & 54 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
name: Tests

on: [ push, pull_request ]
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.0, 8.1, 8.2, 8.3 ]
laravel: [ 8.*, 9.*, 10.*, 11.* ]
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: 11.*
php: 8.2
testbench: 9.*
- laravel: 11.*
php: 8.3
testbench: 9.*
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 8.1
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 }}

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') }}
Expand Down
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# The MIT License (MIT)

Copyright (c) 2017 Ivan Vermeyen (<ivan@codezero.be>)
Copyright (c) 2025 James King (<james@jamesking.dev>)

> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
57 changes: 23 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -21,35 +21,23 @@ 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.4
- [Laravel](https://laravel.com/) >= 11

## 📦 Installation

#### ☑️ 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.

#### ☑️ 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 = [
Expand All @@ -65,7 +53,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:

Expand All @@ -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

Expand Down Expand Up @@ -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 |
Expand All @@ -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:

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -266,17 +254,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

Expand Down
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "codezero/laravel-stagefront",
"name": "jamesking56/laravel-stagefront",
"description": "Quickly add some password protection to a staging site.",
"keywords": [
"laravel",
Expand All @@ -12,16 +12,20 @@
{
"name": "Ivan Vermeyen",
"email": "ivan@codezero.be"
},
{
"name": "James King",
"email": "james@jamesking.dev"
}
],
"require": {
"php": "^7.1|^8.0",
"php": "^8.4",
"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": "^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": "^9.0|^10.0",
"phpunit/phpunit": "^10.0|^11.5.3"
},
"scripts": {
"test": "phpunit"
Expand Down
Loading