an3/multisource
Laravel package for managing multiple data sources in one app. Define and switch between connections/providers (e.g., database or external services) at runtime, keeping config and resolution centralized for cleaner, scalable multi-tenant or multi-source setups.
User model, which may couple tightly to existing auth logic.an3\Multisource\Eloquent\User (or implement its interface).config/app.php and AuthServiceProvider.VerifyCsrfToken, Authenticate, etc.users table with additional columns for multi-source fields (e.g., provider_id, provider_type). Schema migrations may be needed if the existing DB diverges.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Laravel 5.x EOL | Critical | Fork/rebuild for Laravel 8+ or avoid usage. |
| Tight Coupling | High | Abstract multi-source logic via interfaces. |
| Lack of Docs | Medium | Expect trial-and-error; prepare for debugging. |
| No Modern Auth | High | May need parallel OAuth/JWT implementation. |
| No Active Maintenance | High | Risk of breaking changes in Laravel updates. |
Guard extensions) more viable?Illuminate\Contracts\Auth\Guard).Auth::attempt(), Socialite).an3/multisource and test with a dummy User model.an3\Multisource with a custom Guard using Laravel’s AuthManager.// config/auth.php
'guards' => [
'multi' => [
'driver' => 'session',
'provider' => 'multi-source',
],
],
'providers' => [
'multi-source' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
'custom' => MultiSourceAuthService::class, // Your service
],
],
provider_id, provider_type columns). Migration script provided? (Unlikely; manual adjustments needed.)illuminate/auth (Laravel 5.x).Socialite or Passport).User model to support multi-source fields.ServiceProvider.bcrypt or argon2 is used).composer.json updates or CI checks. Manual testing required for every Laravel minor version.an3\Multisource makes switching providers difficult.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| OAuth Provider Down | Users stuck in auth loop. | Fallback to DB auth with warning. |
| Database Unavailable | All auth fails (if DB is primary). | Use OAuth as primary source. |
| Race Conditions | Duplicate user creation. | Add unique constraints on emails. |
| Package Bug (e.g., SQLi) | Security breach. | Use prepared statements; audit code. |
| Laravel 5.x Security Patch | Unpatched vulnerabilities. | Migrate to supported Laravel version. |
How can I help you explore Laravel packages today?