escolalms/course-access

Escola Headless LMS Course Access

Maintainers

👁 qunabu

Package info

github.com/EscolaLMS/Course-Access

Type:package

pkg:composer/escolalms/course-access

Statistics

Installs: 7 156

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.2 2024-03-20 13:34 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 78e1235db0a924c06e163f6cdac9f1186abcd38c

  • Maciej Rymarz <maciej.rymarz.woop@escolasoft.com>

This package is auto-updated.

Last update: 2026-06-10 14:42:54 UTC


README

👁 swagger
👁 codecov
👁 phpunit
👁 downloads
👁 downloads
👁 downloads
👁 Maintainability

What does it do

This package is used to manage access to the course for individual users and user groups.

Additionally, it introduces a mechanism where users can send access enquiries with additional information, and administrators (users with appropriate permissions) can approve or remove them.

Installing

  • composer require escolalms/course-access
  • php artisan migrate
  • php artisan db:seed --class="EscolaLms\CourseAccess\Database\Seeders\CourseAccessPermissionSeeder"

Endpoints

The endpoints are defined in 👁 swagger

Tests

Run ./vendor/bin/phpunit to run tests. Test details 👁 codecov

Events

Course Access Enquiry

  • CourseAccessEnquiryAdminCreatedEvent - This event is dispatched when a student creates an enquiry for course access.
  • CourseAccessEnquiryStudentCreatedEvent - This event is dispatched to all users who have the EnquiryStatusEnum::APPROVE_COURSE_ACCESS_ENQUIRY permission, allowing them to approve the course access enquiry.

These events are listened to by the escolalms/templates-email package, which sends emails based on its own logic. Additionally, notifications are stored in database.

Course Access

  • CourseAssigned and CourseAccessStarted - These events are dispatched when a user is assigned access to a course. It contains information about the user and the course to which access has been granted.
  • CourseUnassigned and CourseFinished - These events are dispatched when a user is denied access to a course.

The escolalms/templates-email package also listens to the above events.

Course Access Enquiry - sequence diagram

sequenceDiagram

 actor Student
 actor Administrator
 participant FrontApp
 participant AdminPanel
 participant Backend

 Student ->> FrontApp: Send access request
 FrontApp ->> Backend: Forward access request
 Backend ->> Backend: Process access request
 alt Request is valid
 Backend -->> Administrator: Notify about new access request
 Backend -->> Student: Send confirmation
 alt Administrator approves request
 Administrator ->> AdminPanel: Access request approval
 AdminPanel ->> Backend: Approve access request
 Backend ->> Backend: Grant access to course
 Backend ->> Student: Send access confirmation
 else Administrator remove request
 Administrator ->> AdminPanel: Access request remove
 AdminPanel ->> Backend: Remove access request
 else Setting auto_accept_access_request is true
 Backend ->> Backend: Grant access to course
 Backend ->> Student: Send access confirmation
 end
 else Request is invalid
 Backend -->> FrontApp: Send invalid request notification
 FrontApp -->> Student: Forward invalid request notification
 end
 
Loading

Permissions

Permissions are defined in seeder.