{"id":37000266,"url":"https://github.com/renderbittechnologies/backpack-2fa","last_synced_at":"2026-01-14T00:01:53.103Z","repository":{"id":320550022,"uuid":"1082511663","full_name":"RenderbitTechnologies/Backpack-2FA","owner":"RenderbitTechnologies","description":"2FA integration for Laravel Backpack using Fortify. Provides Google 2-Factor Authentication for Backpack admin users, including QR codes, recovery codes, and a custom challenge view.","archived":false,"fork":false,"pushed_at":"2025-11-17T13:24:31.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-17T15:17:55.050Z","etag":null,"topics":["backpack","composer-package","fortify","laravel","laravel-package"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/renderbit/backpack-2fa","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RenderbitTechnologies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T10:55:24.000Z","updated_at":"2025-11-17T13:23:07.000Z","dependencies_parsed_at":"2025-10-24T13:07:42.884Z","dependency_job_id":"1b9d9dcb-901a-4795-b329-8607276f0b61","html_url":"https://github.com/RenderbitTechnologies/Backpack-2FA","commit_stats":null,"previous_names":["renderbittechnologies/backpack-2fa"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/RenderbitTechnologies/Backpack-2FA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2FBackpack-2FA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2FBackpack-2FA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2FBackpack-2FA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2FBackpack-2FA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RenderbitTechnologies","download_url":"https://codeload.github.com/RenderbitTechnologies/Backpack-2FA/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RenderbitTechnologies%2FBackpack-2FA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backpack","composer-package","fortify","laravel","laravel-package"],"created_at":"2026-01-14T00:01:52.142Z","updated_at":"2026-01-14T00:01:53.082Z","avatar_url":"https://github.com/RenderbitTechnologies.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backpack 2FA\n\n**2FA integration for Laravel Backpack using Fortify**  \nProvides Google 2-Factor Authentication for Backpack admin users, including QR codes, recovery codes, and a custom challenge view.\n\n## Package Overview\n\nThis package enables secure two-factor authentication for Laravel Backpack admin users. It integrates:\n\n- Laravel Fortify for 2FA handling.\n- PragmaRX Google2FA for QR code generation.\n- Seamless Backpack admin middleware and guards.\n- Recovery codes and 2FA setup flow.\n\n## Features\n\n- Enable/disable 2FA for Backpack admin users\n- Generate QR codes for Google Authenticator\n- Regenerate/download recovery codes\n- Customizable views for 2FA challenge\n- Works with Backpack v6+ and Laravel 10+\n- Full package-based implementation (no app-level Fortify modifications required)\n- Optional middleware `twofactor` to protect routes\n\n## Installation\n\n1. Require the package via Composer:\n\n```bash\ncomposer require renderbit/backpack-2fa\n```\n2. Publish configuration and views (optional):\n\n```bash\nphp artisan vendor:publish --provider=\"Renderbit\\Backpack2fa\\Backpack2FAServiceProvider\" --tag=config\nphp artisan vendor:publish --provider=\"Renderbit\\Backpack2fa\\Backpack2FAServiceProvider\" --tag=views\n```\n\n3. Verify your backpack guard is set in `config/auth.php`:\n\n```php\n'guards' =\u003e [\n    'backpack' =\u003e [\n        'driver' =\u003e 'session',\n        'provider' =\u003e 'users',\n    ],\n],\n```\n\n4. Add the `TwoFactorAuthenticatable` trait from `Laravel\\Fortify\\TwoFactorAuthenticatable` to your authenticable model.\n\n5. Clear config cache:\n\n```bash\nphp artisan config:clear\nphp artisan cache:clear\nphp artisan optimize:clear\n```\n\n## Routes\n\n| Route | HTTP Method | Description |\n|-------|------------|-------------|\n| `/admin/two-factor` | GET | 2FA dashboard: view status, enable/disable 2FA |\n| `/admin/setup-two-factor` | GET | Setup 2FA QR code for the user |\n| `/admin/two-factor/enable` | POST | Enable 2FA for the logged-in user |\n| `/admin/two-factor/disable` | POST | Disable 2FA for the logged-in user |\n| `/admin/two-factor/recovery-codes` | POST | Regenerate recovery codes |\n| `/admin/two-factor/recovery-codes-download` | POST | Download recovery codes as a `.txt` file |\n| `/admin/two-factor/cancel` | GET | Cancel the 2FA setup flow |\n| `/admin/two-factor-challenge` | GET | Display Fortify 2FA login challenge form |\n| `/admin/two-factor-challenge` | POST | Submit Fortify 2FA login challenge form |\n\nAll `/admin` routes use the backpack guard and Backpack admin middleware automatically.\n\n## Middleware\n\n- `twofactor` → Ensures that users have verified 2FA before accessing protected routes.\n- Example usage:\n```php\nRoute::group([\n    'prefix' =\u003e config('backpack.base.route_prefix', 'admin'),\n    'middleware' =\u003e ['web', 'admin', 'twofactor'],\n], function () {\n    Route::get('dashboard', [DashboardController::class, 'index']);\n});\n```\n\n## Summary - Package Installation in New Projects\n\n- `composer require renderbit/backpack-2fa`\n- Publish configs \u0026 views\n- Clear caches\n- Done — routes, controllers, and middleware are ready out-of-the-box.\n\n## License\n\nMIT License © 2025 Renderbit Technologies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderbittechnologies%2Fbackpack-2fa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenderbittechnologies%2Fbackpack-2fa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderbittechnologies%2Fbackpack-2fa/lists"}