From 68d1b16d232a0b041605cc3de271d2515686b9f2 Mon Sep 17 00:00:00 2001 From: IDStack Date: Sun, 11 Oct 2020 22:35:35 +0700 Subject: [PATCH] Membuat API Endpoint Forgot Password --- app/Http/Controllers/Api/Auth/PasswordController.php | 3 +++ routes/api.php | 1 + 2 files changed, 4 insertions(+) diff --git a/app/Http/Controllers/Api/Auth/PasswordController.php b/app/Http/Controllers/Api/Auth/PasswordController.php index 962f6a9..5c88fe4 100644 --- a/app/Http/Controllers/Api/Auth/PasswordController.php +++ b/app/Http/Controllers/Api/Auth/PasswordController.php @@ -3,12 +3,15 @@ namespace App\Http\Controllers\Api\Auth; use App\Http\Controllers\Controller; +use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; use Symfony\Component\HttpFoundation\Response; class PasswordController extends Controller { + use SendsPasswordResetEmails; + public function reset(Request $request) { $request->validate([ diff --git a/routes/api.php b/routes/api.php index a67154c..828b13c 100644 --- a/routes/api.php +++ b/routes/api.php @@ -26,6 +26,7 @@ Route::post('/password/reset', 'Api\Auth\PasswordController@reset') ->middleware('auth:sanctum'); + Route::post('/password/forgot', 'Api\Auth\PasswordController@sendResetLinkEmail'); }); Route::group(['middleware' => 'auth:sanctum'], function () {