I have created a User Registration page with verifying mail using Laravel 7. But my markdown mail is not working. Giving "InvalidArgumentException No hint path defined for [mail]. (View: C:\xampp\htdocs\user_mgmt\resources\views\mail\VerifyMail.blade.php)" error.
Here is my RegistrationController Page.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Users_Profile;
use App\User;
use App\Mail\VerifyMail;
use Sentinel;
use Activation;
use Mail;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
function register(Request $req)
{
$users_profile= new Users_Profile;
$this->validate($req, [
'username' => ['required', 'string', 'max:50', 'unique:users', 'alpha_dash'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
$user = Sentinel::register($req->all());
$users_profile->email=$req->input('email');
$users_profile->save();
$req->session()->put('user',$req->input('username'));
$activate = Activation::create($user);
$this->sendActivationEmail($user, $activate->code);
return redirect('verify');
}
public function sendActivationEmail($user, $code) {
Mail::send(
'mail.VerifyMail',
['user' => $user, 'code' =>$code],
function($message) use ($user) {
$message->to($user->email);
$message->subject("Hello $user->name Activate Your Account.");
}
);
}
}
Here is my Mail Blade Template
@component('mail::message')
#Thank you for registering in LMS
Please, click on the Link below to activate your account
@component('mail::button', ['url' => 'www.google.com' ])
Verify
@endcomponent
Thanks,<br>
{{ config('app.name') }}
@endcomponent
In my Mail controller I am using markdown instead of view in the build function.