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

Pcvue Bridge Bundle Laravel Package

maillotf/pcvue-bridge-bundle

Symfony bundle for connecting PHP applications with PcVue SCADA. It provides bridge services to integrate PcVue data and automation with Symfony, helping developers build interfaces and workflows that exchange information between the two systems.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require maillotf/pcvue-bridge-bundle. Be aware this is a Symfony bundle, not a Laravel package — there is no extra.laravel.providers auto-discovery, so nothing is registered for you.
  • Look first at the bundled Service/PcvueService class (the entry point) and the linked FAQ.md on GitHub. The service exposes sub-clients via public properties (e.g. $service->user), and you drive everything through those.
  • Collect the required connection values before writing code: protocol, host, port, client_id, client_secret, username, password, plus optional root_dir. These are OAuth2 password-grant credentials pointing at a PcVue client.
  • Put them in config/pcvue.php backed by env() rather than hardcoding, since the bundle's own framework.yaml snippet is irrelevant to Laravel.
  • First use case: resolve the service, fetch a user, return a field.
public function show(PcvueService $ps)
{
    $user = $ps->user->getUser('4665');
    return response()->json(['email' => $user->getEmail()]);
}

Implementation Patterns

  • Manual service registration. The Symfony services.yaml alias (PcvueService: '@pcvue.service') has no Laravel equivalent. Register a singleton in a PcvueServiceProvider instead:
$this->app->singleton(PcvueService::class, function () {
    return new PcvueService(
        config('pcvue.authentication.protocol'),
        config('pcvue.authentication.host'),
        config('pcvue.authentication.port'),
        config('pcvue.authentication.client_id'),
        config('pcvue.authentication.client_secret'),
        config('pcvue.authentication.username'),
        config('pcvue.authentication.password'),
        config('pcvue.authentication.root_dir'),
    );
});

Verify the actual constructor signature against the class — the docs only show YAML config, so the mapping from YAML keys to constructor args is something you infer from source.

  • Wrap it in your own adapter. Don't scatter $ps->user->getUser(...) through controllers. Inject PcvueService into a PcvueUserRepository/PcvueGateway class so the rest of the app is insulated from the bundle's public-property API surface, which is fragile.
  • Controller method injection works the same as the docs' Symfony example once the singleton is bound — Laravel's container resolves it identically.
  • Reuse the singleton across requests to avoid re-auth. If the service performs an OAuth2 handshake in its constructor, binding as a singleton prevents repeated token requests within a request lifecycle. If you're calling PcVue in a loop or a queued job, keep one instance.
  • Queues and commands are natural fits: PcVue lookups in a job, with the service injected via constructor and serialized as a dependency-free adapter if you need retries.
  • Testing: bind a fake PcvueService (or your adapter) in the container during tests rather than hitting a live PcVue client.

Gotchas and Tips

  • Config file format mismatch. The release notes only document Symfony YAML (framework.yaml / services.yaml). You must translate both blocks yourself; there is no Laravel config publish.
  • port is a string in the example ("80") — match the expected type when building config from env(), which returns strings anyway.
  • Public-property API. $ps->user is a magic property, not a fluent accessor. It's not discoverable via IDE autocompletion and is easy to break on upgrade. Wrap it early; treat it as an internal detail.
  • Credentials over plain HTTP. The default protocol example is http with a username/password grant. For anything beyond localhost, use https and keep the password out of source control. Note this flow stores the end-user password in config, which is a rotation and secrets-management burden (use a vault / env var, not a committed file).
  • Symfony dependency conflicts. The bundle pulls Symfony components; Laravel also pins Symfony components. If Composer resolution fails, check the bundle's symfony/* constraints against your Laravel version's pinned versions before assuming a bug in your code.
  • root_dir is optional but load-bearing when the bundle resolves relative paths — set it explicitly if you hit file/path errors.
  • Debugging: there's no Laravel logging integration. Log around calls yourself (request target, response status) and catch exceptions at your adapter boundary so OAuth2/HTTP failures surface as domain errors rather than raw transport exceptions.
  • Version 1.0 with sparse docs means the source and FAQ.md are the authority. Pin the version in composer.json and re-read the service class on upgrade — expect API churn on a 1.0 bundle of this maturity.
  • Extension point: the cleanest escape hatch is container rebinding — alias your own adapter to the bundle's service so you can swap implementations (real, mocked, cached) without touching call sites.
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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
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