Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
/package.json export-ignore
/phpunit.xml.dist export-ignore
/.releaserc.json export-ignore
/scripts export-ignore
/tests export-ignore
/vendor export-ignore
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
testbench: '^11.0'
composer-flags: ''
experimental: false
# Laravel 13 is the current package baseline and requires PHP 8.3+.
- name: Laravel 13 / PHP 8.4
php: '8.4'
laravel: '^13.0'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.phpunit.cache
/node_modules
/build
/composer.lock
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ Common commands:

```bash
composer test
composer run test-laravel-13-compat
composer run validate-package
composer run validate-package-publish
```

`composer run test-laravel-13-compat` runs the Beacon suite against a temporary Laravel 13 / Testbench 11 dependency set so you can verify the current compatibility baseline locally without mutating your working tree.

If your change affects release or packaging behavior, also validate the relevant GitHub workflow inputs locally when practical.

## Scope guidance
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"/.releaserc.json",
"/build",
"/docs/RELEASING.md",
"/scripts",
"/node_modules",
"/package-lock.json",
"/package.json",
Expand All @@ -78,6 +79,7 @@
},
"scripts": {
"test": "vendor/bin/pest",
"test-laravel-13-compat": "bash scripts/test-laravel-13-compat.sh",
"validate-package": "@composer validate --strict --no-check-publish",
"validate-package-publish": "@composer validate --strict"
},
Expand Down
78 changes: 78 additions & 0 deletions scripts/test-laravel-13-compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash

set -euo pipefail

root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
temp_dir="$(mktemp -d "${TMPDIR:-/tmp}/beacon-laravel13-compat.XXXXXX")"

cleanup() {
rm -rf "${temp_dir}"
}

trap cleanup EXIT

composer_cmd=()
herd_composer="${HOME}/Library/Application Support/Herd/bin/composer"
php_bin=""

require_supported_php() {
local candidate="$1"
local php_version=""

if ! php_version="$("${candidate}" -r 'echo PHP_VERSION;' 2>/dev/null)"; then
echo "Unable to execute PHP binary '${candidate}' for local Laravel 13 verification." >&2
exit 1
fi

if ! "${candidate}" -r 'exit(version_compare(PHP_VERSION, "8.3.0", ">=") ? 0 : 1);' >/dev/null 2>&1; then
echo "Laravel 13 compatibility tests require PHP 8.3 or newer. Found PHP ${php_version} at '${candidate}'." >&2
exit 1
fi
}

if [[ -n "${PHP_BIN:-}" ]]; then
if ! php_bin="$(command -v "${PHP_BIN}")"; then
echo "Configured PHP_BIN '${PHP_BIN}' was not found. Set PHP_BIN to a PHP 8.3+ binary." >&2
exit 1
fi
elif command -v php84 >/dev/null 2>&1; then
php_bin="$(command -v php84)"
elif command -v php >/dev/null 2>&1; then
php_bin="$(command -v php)"
fi

if [[ -n "${php_bin}" ]]; then
require_supported_php "${php_bin}"
fi

if [[ -n "${php_bin}" && -f "${herd_composer}" ]]; then
composer_cmd=("${php_bin}" "${herd_composer}")
elif command -v composer >/dev/null 2>&1; then
composer_cmd=("$(command -v composer)")
else
echo "Unable to find a usable Composer command for local Laravel 13 verification. Ensure Composer is installed and PHP 8.3+ is available." >&2
exit 1
fi

tar -C "${root_dir}" \
--exclude='./.git' \
--exclude='./vendor' \
--exclude='./node_modules' \
--exclude='./build' \
--exclude='./.phpunit.cache' \
-cf - . | tar -xf - -C "${temp_dir}"

pushd "${temp_dir}" >/dev/null

"${composer_cmd[@]}" update \
--no-interaction \
--no-progress \
--prefer-dist \
--with "illuminate/console:^13.0" \
--with "illuminate/process:^13.0" \
--with "illuminate/support:^13.0" \
--with "orchestra/testbench:^11.0"

"${composer_cmd[@]}" test

popd >/dev/null
Loading