Created
October 19, 2023 12:18
-
-
Save neverything/ba513da4ab18818146598ed6751175e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// On top of the User model add: | |
use App\Notifications\MagicLoginLink; | |
use Grosv\LaravelPasswordlessLogin\PasswordlessLogin; | |
// In the model class, add the following methods: | |
public function sendMagicLoginLinkNotification(): void | |
{ | |
$this->notify(new MagicLoginLink($this->getMagicLoginLink())); | |
} | |
public function getMagicLoginLink(): string | |
{ | |
return PasswordlessLogin::forUser($this)->generate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment