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

davesweb/laravel-translatable

Add translatable attributes to your Eloquent models with locale switching and fallbacks, keeping multilingual content alongside your data in a lightweight, framework-friendly way.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require vendor/package:0.1.0 after confirming the exact package name and Laravel/PHP constraints in its composer.json.
  • Read the README’s quick-start example first, then inspect the package service provider in vendor/vendor/package/src for bindings, config merging, and publish tags.
  • Check whether the package uses Laravel auto-discovery. If its provider is not discovered, register it manually in bootstrap/providers.php or config/app.php depending on your Laravel version.
  • Publish any package config with php artisan vendor:publish --tag=package-config if documented, and review every config key before changing defaults.
  • First use case: wire the package into one low-risk path—a console command, a small controller action, or a single queued job—behind a thin application-level adapter. Run that path in a test before using it more broadly.

Implementation Patterns

  • Wrap package calls behind your own interface or adapter class. Because 0.1.0 explicitly warns of future BC breaks, this keeps upgrades to one application file instead of scattered call sites.
  • Bind the package manager/client in a service provider and inject it. Prefer constructor injection over facades in application code so tests can swap the implementation.
  • Pin the dependency tightly in composer.json (0.1.0 or 0.1.*), commit composer.lock, and treat every 0.x bump as potentially breaking.
  • Keep package config in config/package.php, drive environment-specific values through .env, and run php artisan config:cache in production only after verifying config is final.
  • Add contract tests around your adapter: one happy-path test, one error-handling test, and one config/binding test. Do not rely solely on the package’s own test suite.
  • In queued jobs, serialize your own DTOs or scalar payloads, not package objects. Package classes may change shape between 0.x releases.
  • If the package exposes events, hooks, custom drivers, or manager extensions, integrate through those extension points rather than extending internal classes.
  • Roll out behind a feature flag or config toggle and log inputs/outputs at the adapter boundary during initial use.

Gotchas and Tips

  • 0.1.0 is pre-1.0 and the release notes explicitly allow BC breaks. Treat minor-version upgrades as breaking changes; read the diff and changelog before updating.
  • Release notes are sparse beyond “documented and tested.” Verify actual behavior against the README and source rather than assuming feature completeness.
  • Watch Laravel and PHP version constraints. If installation fails, use composer why-not vendor/package 0.1.0 to identify the conflicting requirement.
  • Auto-discovery can fail if the package’s extra.laravel.providers entry ismissing or malformed. If classes are not found, check manual provider registration.
  • Config caching can hide changes: after editing package config, run php artisan config:clear before re-caching.
  • Publish tags and config keys may change in future 0.x releases. Inspect the service provider’s publishes() and mergeConfigFrom() calls when upgrading.
  • Debug at your adapter boundary with Ray, Telescope, or targeted logging. Avoid debugging through package internals that may disappear.
  • Prefer package-provided extension points—bindings, config, events, custom drivers—over monkey-patching or subclassing internals.
  • If the package uses facades, swap the underlying binding in tests rather than relying on global facade state.
  • Keep an upgrade note that records the pinned version, the adapter surface you rely on, and the tests that must pass after each bump.
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package