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

Nova Opcache Laravel Package

appstract/nova-opcache

Adds a Laravel Nova card showing PHP OPcache status in your dashboard: memory and cache usage, hit rate, cached script counts, and a reset control. Handy for monitoring opcode cache health in production. Requires the OPcache PHP extension.

View on GitHub
Deep Wiki
Context7

Getting Started

The 1.0.0 release is primarily a compatibility release: it adds support for Laravel-opcache v4. Treat it as an upgrade-and-verify release unless the package changelog lists additional features; the release note does not indicate breaking changes. The main day-to-day value remains OPcache visibility and control from Laravel.

  • Install or upgrade with Composer, ensuring your version constraint allows the new v4-compatible release and the matching laravel-opcache v4 dependency.
  • Look first at the package README, any publishable config/opcache.php, and the registered Artisan commands (php artisan list | grep opcache). If the package exposes routes or a dashboard, check the service provider for route registration.
  • Publish config if needed, then clear cached config before testing:
    php artisan vendor:publish --tag=opcache-config
    php artisan config:clear
    
  • First practical use case: run the package’s status command on a host that serves real traffic, not just a CLI container. Confirm OPcache is enabled, inspect memory usage and hit rate, then run a clear/compile cycle after a deploy.
  • If the status command reports OPcache disabled, check opcache.enable, opcache.enable_cli, and opcache.restrict_api before assuming the package is broken.

Implementation Patterns

  • Deployment hook: After composer install, php artisan optimize, and config/route caching, run the package’s OPcache clear command, then a compile/warm command if supported. Finish by reloading PHP-FPM or restarting Octane workers.
  • Multi-server deployments: Run OPcache commands on every app server. OPcache is per PHP process/SAPI instance, so clearing one node does not clear the fleet.
  • Health checks: Expose or script a status check that reports OPcache enabled state, memory consumption, hit rate, and restart count. Alert on low hit rate or frequent resets rather than only checking HTTP 200.
  • Local vs production: In local development, leave opcache.validate_timestamps=1 and avoid relying on manual clears. In production, disabling timestamp validation improves performance but makes explicit clear/invalidate steps mandatory on deploy.
  • Version upgrade workflow for 1.0.0: Update Composer constraints, run composer update, re-publish config only if the package documents new options, clear Laravel caches, and smoke-test each OPcache command. Check Laravel-opcache v4 changelog for command signature or option changes.
  • Integration: Wrap OPcache commands in your deploy script or a custom Artisan command if you need environment-specific behavior, logging, or fan-out across hosts. Avoid scattering raw php artisan opcache:* calls across multiple pipelines.

Gotchas and Tips

  • CLI and FPM are separate OPcache instances. Running an Artisan OPcache clear command from CLI may not clear the cache used by PHP-FPM. Verify how the package executes resets; if needed, use a web endpoint, CacheTool, or an FPM reload.
  • opcache.enable_cli is often off. Status/clear commands executed via CLI may see a different OPcache state than web traffic. Always validate from the SAPI that serves requests.
  • opcache.restrict_api can block commands. If OPcache API calls fail, check this setting and whether the running user/path is allowed.
  • Order matters: clear OPcache after deploying new files and after Laravel config/route/view caching, then warm the cache. Compiling before the final file layout is in place wastes the warm-up.
  • opcache.validate_timestamps=0 is common in production. Without a deploy-triggered clear/invalidate, new code may not be picked up.
  • File cache quirks: If opcache.file_cache or file_cache_only is enabled, clearing shared memory may not be enough; verify the package’s behavior against your OPcache configuration.
  • Permissions and privileges: The deploy user may be able to run Artisan but not reload PHP-FPM. Plan for sudo systemctl reload php-fpm or equivalent, and ensure OPcache file paths are readable by the web user.
  • Debugging checklist: php -i | grep opcache, the package’s status command, PHP-FPM logs, and a phpinfo() page under the web SAPI. Compare CLI and web output before filing an issue.
  • Upgrade caution: Since 1.0.0 is a compatibility release for Laravel-opcache v4, pin compatible versions and re-test command names/options. Do not assume old aliases or undocumented behavior survived v4.
  • Extension points: Prefer composing around the package’s commands/config rather than editing vendor code. If the package exposes contracts, events, or config-driven paths, bind or override those in your app to customize behavior cleanly.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings