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

Client Laravel Laravel Package

use-lock/client-laravel

Official Laravel client for UseLock, adding distributed locking to your Laravel apps. Register the service provider, publish the config, and guard critical sections with a simple, fluent API. Lightweight integration with sensible defaults for quick setup.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Require use-lock/client-laravel:^0.3; this release pulls in use-lock/client-php:^0.2.
  • Publish the package config (php artisan vendor:publish --provider="UseLock\Client\Laravel\LockServiceProvider" or the package’s publish tag) and set credentials in .env.
  • Look first at config/lock.php and the package service provider to confirm the container binding and config keys.
  • First use case: inject the Lock client into a controller or queued job and make a single read call to validate credentials and response shape.

Implementation Patterns

  • Prefer constructor injection of the bound client/interface over resolving it from the container inline.
  • Keep Lock calls in dedicated service classes or actions; avoid calling the client directly from Eloquent models or config files.
  • For multi-tenant or per-user credentials, use the package’s client factory/scoped instance rather than mutating global config at runtime.
  • Put write operations behind Laravel queues when they can be retried; add your own retry/backoff if the client does not provide it.
  • In tests, bind a fake implementation or mock the underlying HTTP layer so tests do not depend on live Lock credentials.
  • If the package exposes a facade, use it sparingly (e.g. Blade/views) and prefer injection elsewhere for testability.

Gotchas and Tips

  • 0.3.0 is primarily a dependency alignment to use-lock/client-php 0.2. Treat the underlying SDK as potentially breaking: run composer update use-lock/client-laravel use-lock/client-php, then run integration tests and check the client-php changelog for method/response changes.
  • After changing credentials in .env, run php artisan config:clear locally and php artisan config:cache in production.
  • Avoid resolving the client during config loading or model boot methods; it can break config:cache and cause hard-to-trace boot failures.
  • Confirm the resolved dependency version with composer why use-lock/client-php; pin "use-lock/client-laravel": "^0.3" and avoid overriding the transitive client-php constraint.
  • For debugging, log request IDs or response metadata from the client, and enable any package debug logging if available.
  • Extension point: bind your own wrapper/decorator in a service provider if you need custom retries, logging, or middleware around the client.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core