first_name= $request->firstname; $data->last_name= $request->lastname; $data->email= $request->email; $data->phone_number= $request->phonenumber; $data->university_name= $request->universityname; $data->designation= $request->designation; $data->department= $request->department; $data->user_type= 1; Mail::to('test@mail.com')->send(new TeacherSignUp($data->id)); return redirect()->back()->with('success','Account created successfully. Please check your email and activate your account.'); } }