Laravel kirim email Unable to resolve NULL driver for [Illuminate\Mail\TransportManager]

Ada yang tau ini kenapa
image.pngimage.png
public function sendResets(Request $request)
    {

         $cekEmail = User::where('email', $request->email)->first();
         if ($cekEmail) {
              $datapw = new PasswordReset;
              $datapw->email = $request->email;
              $datapw->token = Str::random(6);

              if ($datapw->save()) {
                   try{
                        Mail::send('email-reset', ['token' => $datapw->token], function ($message) use ($request)
                        {
                             $message->subject('Reset Password');
                             $message->from('[email protected]', 'Reset Password');
                             $message->to($request->email);
                        });
                   }
                  catch (Exception $e){
                        return response (['status' => false,'errors' => $e->getMessage()]);
                   }
                   return response()->json(['msg'=>'Email terkirim']);
              }else {
                   return response()->json(['msg'=>'Email tidak terkirim']);
              }
         }else {
              return response()->json(['msg'=>'Email tidak terdaftar']);
         }    
}

avatar rizkiputra4545

@rizkiputra4545

5 Kontribusi 6 Poin


Jawaban

Belum ada Jawaban, jadi yang pertama

Login untuk gabung berdiskusi