Skip to content

Fix: merge persistent rules from config and plugin#12

Merged
awcodes merged 5 commits into
1.xfrom
fix/merge-persistent-rules
Jun 8, 2026
Merged

Fix: merge persistent rules from config and plugin#12
awcodes merged 5 commits into
1.xfrom
fix/merge-persistent-rules

Conversation

@awcodes

@awcodes awcodes commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #5. Persistent rules defined in config('botly.persistent_rules') were silently dropped whenever rules were also set via BotlyPlugin::make()->persistentRules(...).

The cause was a null-coalesce in getPersistentRules() that short-circuited the config lookup as soon as the plugin had rules set:

return $this->persistentRules ?? config('botly.persistent_rules', []);

Both sources are now merged, with config rules first followed by plugin rules.

Testing

  • Added a test covering the combined config + plugin case.
  • composer test passes (Rector, Pint, PHPStan level 5, 37 Pest tests).

🤖 Generated with Claude Code

awcodes and others added 5 commits June 8, 2026 11:59
Previously, setting persistent rules via BotlyPlugin::make()->persistentRules()
caused any rules defined in config('botly.persistent_rules') to be ignored
because getPersistentRules() used a null-coalesce that short-circuited the
config lookup. Both sources are now merged, with config rules first followed
by plugin rules.

Fixes #5

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Laravel 11's security support window has ended, so Composer now refuses to
install any 11.x release because they're flagged by security advisories,
breaking the tests and phpstan matrices. Disable advisory blocking for the
matrix install step so we can still test against Laravel 11.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The package supports filament/filament ^4.0|^5.0, but the matrix only ever
tested the latest (v5) via prefer-stable. Filament 4 and 5 share the same
Laravel/PHP support range (^11.28|^12|^13, PHP ^8.2), so Filament version is
orthogonal to the Laravel axis. Rather than doubling the matrix, the base
matrix is pinned to Filament 5 and a single Filament 4 job per Laravel line is
added via include (+3 jobs per workflow).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Filament 5 pulls in Livewire 4, which requires PHP 8.3+, so Filament 5 is not
installable on PHP 8.2. Pinning the base matrix to filament 5.* forced that
impossible combo and broke the PHP 8.2 phpstan jobs (previously they resolved
to Filament 4 implicitly). PHP 8.2 is now exercised against Filament 4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Laravel 11 is EOL, so there's no value in spending CI time on it (the package
still supports it as a transitive Filament dependency). Removing it also lets
us drop the advisory-block workaround, since that only existed because EOL
Laravel 11 releases are flagged by security advisories. PHP 8.2 coverage is
kept on Laravel 12 + Filament 4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@awcodes
awcodes merged commit 6a1b3ce into 1.x Jun 8, 2026
17 checks passed
@awcodes
awcodes deleted the fix/merge-persistent-rules branch June 8, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Plugin settings and Config should merge

1 participant