Last active
January 14, 2021 09:23
-
-
Save patrocle/665da18e07d211c7667ea78aa39ee5b3 to your computer and use it in GitHub Desktop.
Laravel 8 - send email to user with reset password link
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 | |
namespace App\Console\Commands; | |
use App\Models\User; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\Password; | |
class UserNewPasswordCommand extends Command | |
{ | |
protected $signature = 'user:new-password {email?}'; | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
public function handle() | |
{ | |
$email = $this->argument('email'); | |
$user=User::where('email',$email)->firstOrFail(); | |
$status = Password::sendResetLink( | |
['email'=>$email] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment