Course Registration

  • courses 1

    Home page
  • courses 2

    Search form in every page
  • courses 3

    Course categories
  • courses 4

    Courses in each categories
  • courses 5

    Student dashboard - All my courses
  • courses 6

    All courses with "registered" label when students logged in
  • courses 7

    Course detail page with "registered or not" label when students logged in
  • courses 8

    Teacher dashboard
  • courses 9

    Course detail shows student list for teachers
  • courses 10

    Admin user panel

Source code: https://github.com/sunnygreentea/laravel-course-registration


This courses demo is to simulate the process of course registration and management.

All the courses have a name, category, teacher, students, room, date and time, and description. Courses can be classified by category. Users can search courses by name and category.

When students log in, they can see their list of registered courses and course detail, they can register a course or remove a course from their list.

When a teacher logs in, he/she can see a list of courses that he/she teaches. For each course, the teacher can see all the students registered in this course.

The login panel for both students and teachers share the same look as the website.

When an admin user logs in, he/she has a different layout of admin panel. Admin user has the authorization of managing users, permission, courses, categories, etc.

Database:

All admin users, teachers, and students are stored in “Users” table, each course has one teacher, and may have many students, so courses and teachers have a “one to many” relationship, courses and students have a “Many to Many” relationship.

Features:

Totally separated frontend website, teachers and students panel, and admin panel

  • Routes: three groups: front, user and admin.
  • Controllers: three folders: front, user and admin.
  • Views: two layouts: front and admin. Frontend website and normal user panel share same layout while admin panel has a different layout. Three folders for blade files: front, user, and admin

Triple layers of admin authentication and authorization:

  • User authentication: besides of Laravel default user login authentication, the project also added a route middleware isAdmin to check if a logged-in user is admin or not, if yes, redirect to admin panel, if not admin redirect to normal user panel.
  • Gate: defined different permissions what admin user and normal user (teacher and student) can do.
  • Middleware group: added middleware AuthGates to group “api” and “web”. Each function of admin controllers checks if user has the right permission to do the action like CRUD, if not redirect to 403 forbidden page.