Skip to content

Instantly share code, notes, and snippets.

@patrocle
Last active January 14, 2021 09:23
Show Gist options
  • Save patrocle/665da18e07d211c7667ea78aa39ee5b3 to your computer and use it in GitHub Desktop.
Save patrocle/665da18e07d211c7667ea78aa39ee5b3 to your computer and use it in GitHub Desktop.
Laravel 8 - send email to user with reset password link
<?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