socialiteproviders/weixin
Adds Weixin (WeChat) OAuth login to Laravel Socialite. Install via Composer, configure your WeChat app ID and secret, then authenticate users through the Weixin provider with a familiar Socialite workflow.
Release 4.1.0 is an additive compatibility release: it adds PHP 8 support without an indicated breaking API change. Start by confirming your environment and the package’s new constraints.
php -v
composer why-not php 8.0
composer require vendor/package:^4.1 --with-all-dependencies
composer.json first — look for the service provider, facade, published config tag, and migration tag.php artisan vendor:publish --tag=package-config
php artisan vendor:publish --tag=package-migrations
php artisan package:discover
php artisan config:clear
php artisan tinker or a throwaway route, call its simplest read-only method, and confirm the published config values are being read:
$service = app(Vendor\Package\Contracts\Service::class);
dump($service->healthCheck());
If you are already on PHP 8, treat 4.1.0 as a low-risk upgrade, but still run your application’s test suite and any package-specific integration tests before deploying.
Constructor injection over facades in application code. Resolve the package’s contracts through Laravel’s container so tests can swap fakes and so long-running workers do not hold stale facade roots:
final class SyncOrders
{
public function __construct(
private readonly Vendor\Package\Contracts\Client $client,
) {}
public function __invoke(): void
{
$this->client->sync();
}
}
Configuration-driven setup. Keep package options in config/package.php, drive environment-specific values through .env, and ensure the config file contains no closures if you use php artisan config:cache.
Wrap package calls in application boundaries. Put package calls behind a small application service or action class. This keeps package-specific types out of controllers, Livewire components, and domain models, and makes future upgrades easier.
Use jobs and events for anything remote. If the package performs HTTP calls, file operations, or writes to external systems, dispatch it from a queued job and use the package’s events or your own events for follow-up work. Combine with DB::transaction() only when the package operation is part of a database workflow.
Exploit PHP 8 syntax in integrations, not in assumptions about the package. Constructor property promotion, named arguments, union types, and match expressions are useful in your own adapters. Do not rely on named arguments when calling package methods unless the package explicitly documents parameter names as stable API.
Testing pattern. Use RefreshDatabase for database-backed packages, Http::fake() and Queue::fake() where appropriate, and bind a fake implementation of the package contract in the container:
$this->app->instance(
Vendor\Package\Contracts\Client::class,
new FakePackageClient(),
);
CI matrix. Since this release targets PHP 8, run your test suite against the PHP versions you actually deploy on (for example 8.1–8.3) rather than assuming “PHP 8” means all 8.x versions behave identically.
composer.json php constraint and any transitive dependencies. Use composer why-not php 8.0 or composer why-not php 8.3 to diagnose resolution failures.error_reporting(E_ALL) in development.php artisan config:clear, php artisan cache:clear, and composer dump-autoload after changing the package version. Stale bootstrap/cache files are a common source of confusing behaviour.env(). If the package’s config file calls env() outside the config directory, or if you cache config after changing .env, values may not update as expected.Facade::clearResolvedInstance() between requests/jobs when package state is request-specific.bootstrap/cache/packages.php, run php artisan package:discover, and confirm the package’s extra.laravel.providers entry.^4.1) and review the changelog again before moving to 5.x. Run your integration tests against the new version in a branch before merging.How can I help you explore Laravel packages today?