TeacherController.php 782 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. class TeacherController extends Controller
  5. {
  6. public function teacherSignup(Request $request)
  7. {
  8. $data= New User;
  9. $data->first_name= $request->firstname;
  10. $data->last_name= $request->lastname;
  11. $data->email= $request->email;
  12. $data->phone_number= $request->phonenumber;
  13. $data->university_name= $request->universityname;
  14. $data->designation= $request->designation;
  15. $data->department= $request->department;
  16. $data->user_type= 1;
  17. Mail::to('test@mail.com')->send(new TeacherSignUp($data->id));
  18. return redirect()->back()->with('success','Account created successfully. Please check your email and activate your account.');
  19. }
  20. }