/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $user = \Auth::user();
     $count = 1;
     $teachers = Teacher::all();
     return view('admin.teachers.index', compact('teachers', 'count', 'user'));
 }
Ejemplo n.º 2
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::guest()) {
         return view('home');
     }
     $user = \Auth::user();
     $classes = [];
     $totalClasses = Classe::all()->count();
     $totalSubjects = Subject::all()->count();
     $totalStaffs = Teacher::all()->count();
     $totalStudents = Student::all()->count();
     if ($user->type != "Student") {
         $id = Teacher::where('teacherId', $user->userId)->get();
         foreach ($id as $id) {
             $id = $id->id;
         }
         $teacher = Teacher::find($id);
         //dd($teacher);
         //dd($teacher);
         foreach ($teacher->classes as $classe) {
             $classes[] = $classe;
         }
         foreach ($teacher->subjects as $subject) {
             $subjects[] = $subject;
         }
     }
     //dd($subjects);
     return view('dashboard', compact('classes', 'totalClasses', 'totalSubjects', 'totalStaffs', 'totalStudents', 'user'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $user = Auth::user();
     $staff = Teacher::all();
     $classList = Classe::lists('name', 'id');
     $subjectList = Subject::lists('name', 'id');
     $subjectAssigned = SubjectAssigned::all();
     return view('Admin.subjectAssigned.index', compact('subjectList', 'classList', 'staff', 'user', 'assignedClass', 'subjectAssigned'));
 }