{"id":42976911,"url":"https://github.com/norbybaru/laravel-passwordless-authentication","last_synced_at":"2026-01-31T01:37:43.558Z","repository":{"id":58626669,"uuid":"257735116","full_name":"norbybaru/laravel-passwordless-authentication","owner":"norbybaru","description":"Laravel Passwordless Authentication with Magic Link","archived":false,"fork":false,"pushed_at":"2025-08-18T22:20:37.000Z","size":80,"stargazers_count":21,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T11:02:40.678Z","etag":null,"topics":["laravel-authentication","laravel-magic-link","laravel-passwordless-authentication","magic-link-authentication","passwordless-authentication"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/norbybaru.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-04-21T22:57:43.000Z","updated_at":"2025-06-04T12:34:15.000Z","dependencies_parsed_at":"2023-11-22T18:40:35.969Z","dependency_job_id":"c8411d93-dee0-4aaa-9c1b-d317ae5b13a5","html_url":"https://github.com/norbybaru/laravel-passwordless-authentication","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"2b5460829c5409461eb73a9a6c6f27ff89dd5144"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/norbybaru/laravel-passwordless-authentication","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norbybaru%2Flaravel-passwordless-authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norbybaru%2Flaravel-passwordless-authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norbybaru%2Flaravel-passwordless-authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norbybaru%2Flaravel-passwordless-authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/norbybaru","download_url":"https://codeload.github.com/norbybaru/laravel-passwordless-authentication/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norbybaru%2Flaravel-passwordless-authentication/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28926283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T22:32:35.345Z","status":"ssl_error","status_checked_at":"2026-01-30T22:32:31.927Z","response_time":66,"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":["laravel-authentication","laravel-magic-link","laravel-passwordless-authentication","magic-link-authentication","passwordless-authentication"],"created_at":"2026-01-31T01:37:43.036Z","updated_at":"2026-01-31T01:37:43.551Z","avatar_url":"https://github.com/norbybaru.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Run Unit Tests](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/run-tests.yml) [![PHPStan](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/phpstan.yml) [![Laravel Pint](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/pint.yml/badge.svg?branch=main)](https://github.com/norbybaru/laravel-passwordless-authentication/actions/workflows/pint.yml)\n\n![PASSWORDLESS-AUTH](./loginlink.png)\n# LARAVEL PASSWORDLESS AUTHENTICATION\nLaravel Passwordless Authentication using Magic Link.\n\nThis package enables authentication through email links, eliminating the requirement for users to input passwords for authentication. Instead, it leverages the user's email address to send a login link to their inbox. Users can securely authenticate by clicking on this link. It's important to note that the package does not include a user interface for the authentication page; it assumes that the application's login page will be custom-built. Make sure to scaffold your login UI page accordingly to integrate seamlessly with this package.\n\n**PS. Email provider must be setup correctly and working to email magic link to authenticate user**\n\n## Installation\n\n```sh\ncomposer require norbybaru/passwordless-auth\n```\n\n## Publishing the config file\n```sh\nphp artisan vendor:publish --provider=\"NorbyBaru\\Passwordless\\PasswordlessServiceProvider\" --tag=\"passwordless-config\"\n```\n\n## Preparing the database\nPublish the migration to create required table:\n```sh\nphp artisan vendor:publish --provider=\"NorbyBaru\\Passwordless\\PasswordlessServiceProvider\" --tag=\"passwordless-migrations\"\n```\nRun migrations.\n```sh\nphp artisan migrate\n```\n\n# Basic Usage\n## Preparing Model\nOpen the `User::class` Model and ensure to implements `NorbyBaru\\Passwordless\\CanUsePasswordlessAuthenticatable::class` and to add trait `NorbyBaru\\Passwordless\\Traits\\PasswordlessAuthenticatable::class` to the class\n\n```php\n\u003c?php\n\nnamespace App\\Models;\n\n...\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Illuminate\\Notifications\\Notifiable;\nuse NorbyBaru\\Passwordless\\CanUsePasswordlessAuthenticatable;\nuse NorbyBaru\\Passwordless\\Traits\\PasswordlessAuthenticatable;\n\nclass User extends Authenticatable implements CanUsePasswordlessAuthenticatable\n{\n    ...\n    use Notifiable;\n    use PasswordlessAuthenticatable;\n    ...\n}\n```\n\n## Preparing `config/passwordless.php`\nOpen config file `config/passwordless.php`\n- Update `default_redirect_route` to the correct route name the user should land by default once authenticated in case you have different route name than `home`.\neg.\n```\n'default_redirect_route' =\u003e 'dashboard',\n```\n\n- Update `login_route` to the correct route name of your login page to allow redirecting user\nback to that page on invalid magic link.\neg.\n```\n'login_route' =\u003e 'auth.login',\n```\n\n## Setup Login Routes\nUpdate application Login routes to sen Magic Link to user\n\n```php\n\u003c?php\n\nuse Illuminate\\Support\\Facades\\Route;\n\nRoute::post('login', function (Request $request) {\n    $validated = $request-\u003evalidate([\n        'email' =\u003e 'required|email|exists:users',\n    ]);\n\n    $status = Passwordless::magicLink()-\u003esendLink($validated);\n\n    return redirect()-\u003eback()-\u003ewith([\n        'status' =\u003e trans($message)\n    ]);\n});\n\n```\n\n## Setup Mail Provider\nMake sure to have your application mail provider setup and working 100% for your Laravel application\n```\nMAIL_MAILER=\nMAIL_HOST=\nMAIL_PORT=\nMAIL_USERNAME=\nMAIL_PASSWORD=\nMAIL_ENCRYPTION=tls\nMAIL_FROM_ADDRESS=\nMAIL_FROM_NAME=\"${APP_NAME}\"\n```\n\n## Setup Translations\nAdd file `passwordless.php` in your translations directory and copy the entry below.\nFeel free to update text to suit your application needs.\n\n```php\nreturn [\n    'sent' =\u003e 'Login link sent to inbox.',\n    'throttled' =\u003e 'Login link was already sent. Please check your inbox or try again later.',\n    'invalid_token' =\u003e 'Invalid link supplied. Please request new one.',\n    'invalid_user' =\u003e 'Invalid user info supplied.',\n    'verified' =\u003e 'Login successful.',\n];\n```\n\n# Advance Usage\n## Override MagicLinkNotification\n\nTo override default notification template, override method `sendAuthenticationMagicLink` in your User model which implements interface `CanUsePasswordlessAuthenticatable`\n\n```php\npublic function sendAuthenticationMagicLink(string $token): void\n{\n    // Replace with your notification class.\n\n    // eg. $this-\u003enotify(new SendMagicLinkNotification($token));\n}\n```\n\n## Run Unit Test\n```sh\ncomposer test\n```\n\n## Run Code Formatter\n```sh\ncomposer fmt\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorbybaru%2Flaravel-passwordless-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorbybaru%2Flaravel-passwordless-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorbybaru%2Flaravel-passwordless-authentication/lists"}