Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Statamic Peak Browser Appearance Laravel Package

studio1902/statamic-peak-browser-appearance

A Statamic Peak addon that lets you customize browser appearance settings, like theme colors and favicons, so your site looks polished in tabs and on mobile devices. Simple to configure and built to fit seamlessly into the Peak workflow.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Requires Statamic v6. v4.0.0 is a major release that adds Statamic v6 support. If you're still on Statamic v5, stay on the v3 line until you upgrade Statamic.
  • Install via Composer (auto-discovery is enabled):
    composer require robdekort/<package-name>
    Replace <package-name> with the actual package handle from the release.
  • Publish any config if the package provides it:
    php artisan vendor:publish --tag=<package-config>
  • First use case: after installation, your global variables/sets become available in Antlers/Blade as documented. Start by rendering a global variable in a template to confirm the package is wired up.
  • If you need to react to global variable changes, the package now uses Statamic's GlobalVariablesSaved event. That's the first place to look when integrating custom logic.

Implementation Patterns

  • Template usage: Use the package's provided tags/facade to read global variables in Antlers or Blade. Keep global variable access centralized (e.g., a view composer or a dedicated service) so you can swap the underlying implementation later.
  • Programmatic updates: When saving global variables via Statamic's repositories, the package will now respond to GlobalVariablesSaved. This means any package-level side effects (cache clearing, syncing, etc.) happen after the save completes.
  • Custom listeners: If you need to run your own logic after globals are saved, register a listener for GlobalVariablesSaved in your EventServiceProvider or use the package's extension points. Example:
    Event::listen(GlobalVariablesSaved::class, function ($event) {
        Cache::forget('global-variables');
    });
    
  • Cache invalidation: If you cache rendered output that depends on global variables, listen to GlobalVariablesSaved to clear those caches. This is the idiomatic Statamic v6 event for that lifecycle hook.
  • Testing: Use Event::fake([GlobalVariablesSaved::class]) in tests and assert the event is dispatched when saving globals. This verifies your integration without hitting the database.

Gotchas and Tips

  • Major version bump: v4.0.0 drops support for older Statamic versions. Check your composer.json constraints and run composer update in a branch before merging.
  • Event change: The package switched to GlobalVariablesSaved. If you previously listened to a different event (e.g., GlobalSetSaved or a custom event), update your listeners. The new event fires after the save, so pre-save logic must use a different hook.
  • Double listeners: If the package already listens to GlobalVariablesSaved internally, avoid registering duplicate listeners that perform the same cache clearing or syncing.
  • Clear caches after upgrading: Run php artisan cache:clear, php artisan config:clear, and php artisan view:clear after upgrading to v4 to avoid stale configuration or compiled views.
  • Extension points: Check the package's config file for toggles (e.g., enabling/disabling automatic cache clearing). Publish the config if you need to customize behavior.
  • Debugging: If global variable changes aren't reflected, verify that saves are going through Statamic's standard repository (which dispatches GlobalVariablesSaved). Direct database updates will bypass the event and any package behavior tied to it.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource