View [emails.test] not found

Posted 2 months ago by yafeearun

I have to tried to send a mail from API controller and i got the error "View [\emails.test] not found"

API controller

use App\Mail\Email;

public function TestEmail(){
      $data = ['message' => 'This is a test!'];
      \Mail::to('[email protected]')->send(new Email($data));
 }

Email class

return $this->view('emails.test') ->from($address, $name) ->cc($address, $name) ->bcc($address, $name) ->replyTo($address, $name) ->subject($subject) ->with([ 'message' => $this->data['message'] ]);

View location

app/resources/views/emails/test.blade.php

Please sign in or create an account to participate in this conversation.