public function getEditProfile() { $defaultsubjects = DefaultSubject::all(); if (Auth::user()->type == 'tutor') { return view('project.main.tutor.editprofile')->with('title', 'Edit Profile | ' . $this->sitename)->with('defaultsubjects', $defaultsubjects)->with('vat', 20); } else { if (Auth::user()->type == 'student') { return view('project.main.student.editprofile')->with('defaultsubjects', $defaultsubjects)->with('title', 'Edit Profile | ' . $this->sitename); } else { if (Auth::user()->type == 'admin') { } else { return redirect()->route('auth.login'); } } } }
public function getAdminSubjectDelete($id) { if (Auth::user()->type == 'admin') { $deletesubject = DefaultSubject::where(['id' => $id])->delete(); if ($deletesubject) { return response()->json(['status' => 'success', 'message' => 'successfully Deleted subject ']); } else { return response()->json(['status' => 'failed', 'message' => 'Failed to Delete subject ']); } } else { return redirect()->route('home'); } }