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

Laravel Optimizer Laravel Package

godforheart/laravel-optimizer

A lightweight Laravel package that simplifies application optimization by caching configuration, routes, events, and views. It provides Artisan commands to run and clear Laravel's optimization caches, helping improve performance with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

This package's v1.0.8 release is a compatibility release — the headline change is Laravel 12 support. That makes it the first version you should reach for on a Laravel 12 app, and the upgrade target if you're currently pinned to an older major.

Minimal steps:

  1. Confirm your runtime floor. Laravel 12 requires PHP 8.2+, so check php -v before bumping anything.
  2. composer require <vendor>/<package>:^1.0.8 — pin to ^1.0.8 rather than ^1.0 only if you need to guarantee the Laravel 12-compatible code path during rollout.
  3. Check for a published config: php artisan vendor:publish --provider="<Vendor>\<Package>\<Package>ServiceProvider" --tag=config. Most Laravel packages ship one; read it before writing any code, since it usually documents the extension points.
  4. Look first at the package's composer.json (illuminate/* constraints), its service provider (what it binds and registers), and any README section on Laravel version support. Those three tell you more than the release notes do.

First use case: run your existing test suite against the new version on a branch before touching production config. This release changes framework compatibility, not (as far as the notes state) package behaviour, so the fastest signal is whether your current integration still passes on Laravel 12.

Implementation Patterns

Treat v1.0.8 as a drop-in within the 1.x line and plan the upgrade like any other dependency bump:

  • Version-constraint audit. If your composer.json pins laravel/framework to ^11.0, upgrading the package alone won't help — you'll need the framework constraint raised too, and composer why-not laravel/framework 12.* is the quickest way to find what's blocking it.
  • Upgrade in a branch with a fresh composer update. Don't mix this with feature work; compatibility bumps are easiest to bisect when they're an isolated commit.
  • Run the suite in CI against both Laravel 11 and 12 if you support both. A matrix build (laravel/framework: ^11.0 || ^12.0) is the standard way to keep a package-adjacent integration honest across majors.
  • Isolate the package behind your own binding where it's practical — a thin wrapper class or an interface bound in a service provider. That keeps a future major-version break (or a Laravel 13 bump) contained to one file instead of scattered call sites.
  • Verify auto-discovery. Laravel 12 still uses package discovery, but if you have dont-discover entries in composer.json, confirm the provider is still registered after the update — php artisan about and php artisan package:discover will show it.

Gotchas and Tips

  • The release note is one line. "兼容 laravel 12" tells you the constraint was widened; it says nothing about whether internal behaviour changed. Read the diff between v1.0.7 and v1.0.8 (or at least the composer.json and CHANGELOG) before assuming it's a no-op.
  • Constraint widening ≠ tested. A package can declare ^12.0 support and still have deprecation warnings or subtly broken behaviour on Laravel 12. Check the package's CI matrix if it's public.
  • Transitive dependency conflicts are the usual failure mode, not the package itself. If composer update fails, the error almost always names a third-party package that hasn't added ^12.0 yet — check that one, not this one.
  • PHP version is the second-most-common blocker. Laravel 12 dropped support for PHP 8.1; a passing composer update on 8.1 is not possible, so upgrade PHP first if you haven't.
  • Config caching hides stale registrations. After upgrading, run php artisan config:clear and php artisan cache:clear before debugging "the package isn't loading" — in a cached environment the old provider registration can persist.
  • Extension points to prefer: published config over editing vendor files, container bindings over static calls, and package events/listeners over monkey-patching. Anything you customise in vendor/ disappears on the next composer update.
  • Pin sensibly. Use ^1.0.8 (not 1.0.8) so you keep picking up patch fixes, but if a future 1.1 or 2.0 lands, read its notes before letting it in — this package's history suggests version bumps track framework majors.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator