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 Enums Laravel Package

peltonsolutions/laravel-enums

A Laravel package for working with PHP enums, offering convenient helpers and framework integration for defining, validating, casting, and using enum values across models, requests, and application code.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Require the package with Composer and confirm your app is on Laravel 11 / PHP 8.2+ (this release is gated to Laravel 11):
    composer require vendor/package
    
  2. Publish config and any migrations, then inspect the published files first — they are the primary documentation of defaults and available keys:
    php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider"
    
  3. Check the service provider for container bindings, singletons, and any auto-registered middleware/gates before writing integration code.
  4. First use case: wire the package into a single existing flow (e.g. one controller action or one queued job) and verify the happy path end-to-end before broadening usage.

Implementation Patterns

  • Resolve through the container, not new. Bind interfaces or use the package facade so your app picks up published config and any swaps you make in a service provider.
  • Config-first customization. Edit config/package.php rather than overriding internals; keep environment-specific values in .env and reference them from config so config caching stays safe.
  • Wrap in a thin service layer. Put package calls behind a small app-level class (App\Services\YourService). This keeps controllers testable and gives you one place to adapt if the package changes again.
  • Testing. Use RefreshDatabase for anything touching package persistence, and Bus::fake() / Http::fake() when the package dispatches jobs or makes outbound calls. Assert on your service layer's output rather than package internals.
  • Queues and scheduling. If the package ships jobs or commands, run them through the scheduler with onOneServer() / withoutOverlapping() where appropriate, and confirm queue connections are configured before enabling in production.
  • Laravel 11 alignment. Match the new skeleton conventions — bootstrap/app.php for middleware and exception handling, no Kernel.php. If you registered the package's middleware or exception hooks in the old Kernel, move them to Application::configure()->withMiddleware() / ->withExceptions().

Gotchas and Tips

  • This release is Laravel 11 only. If you maintain apps on 10.x, pin the package with a version constraint that resolves to the prior line — don't assume a shared code path across majors.
  • PHP floor moved. Laravel 11 requires PHP 8.2; check CI matrices and any polyfills before upgrading.
  • Laravel 11 trimmed defaults. config/ files are slimmer and many defaults live in the framework now. If the package reads a config key that used to be published by default, it may silently fall back — verify after upgrade.
  • Config caching traps. Env vars read outside config files return null once config is cached. Confirm the package only touches env() from within its config file.
  • Cache config:clear when testing config changes. Published config changes won't surface behind a stale bootstrap cache; this is the most common "the update broke it" false alarm.
  • Extension points. Prefer binding interfaces in your own provider over extending package classes — you're insulated from internal refactors in future releases.
  • Debugging. Reproduce with the Laravel debugbar or Log::withContext() around your service layer call site; failures inside package internals are easier to isolate at the boundary than in the stack trace.
  • No changelog detail beyond the Laravel 11 bump. Treat other behavior as unchanged but unverified — smoke-test the flows you actually depend on rather than assuming a no-op.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib