Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/RigbySawGame/ieeEdu_Wen/llms.txt

Use this file to discover all available pages before exploring further.

IEE Edu’s Premium subscription model grants students access to the full course catalog for the duration of their plan. Administrators can manually create subscriptions for students (for example, after a bank transfer payment), toggle active subscriptions on or off, and permanently delete subscription records. The platform’s SubscriptionObserver and SubscriptionAccessService keep course access in sync automatically whenever a subscription changes state.

Subscription List

GET /admin/subscriptions
Returns a paginated list of all subscriptions, each loaded with the associated user (id, name, email). The response also enriches each record with three computed fields derived from the most recent related payment, giving the reviewing admin full context without opening a separate payment page: payment_amount (the payment total in PEN), payment_capture (the comprobante image URL), and payment_status (the payment status string). Supported query parameters:
ParameterDescription
searchFilter by user name or email
per_pageResults per page (default 20)

Create Subscription

Manually grant a Premium subscription to a student. This flow also creates an associated aprobado payment record for bookkeeping.
POST /admin/subscriptions
FieldTypeNotes
user_idintegerRequired; the student to subscribe
typestringPlan slug, e.g. trimestral, semestral, or anual
monthsintegerDerived from the plan; sets the end_date offset
amountnumericPayment amount to record
comprobantefileOptional proof-of-payment image (multipart)
1

Select the student

Use the user search AJAX endpoint (GET /admin/users-search?q=...) to find the student’s user_id.
2

Choose a plan

Select from the available plan options returned in the planOptions prop. Valid slugs include trimestral, semestral, and anual.
3

Submit the form

On success, any previously active subscription for that user is expired, the new subscription is created with status = activa, and SubscriptionAccessService::grantAccess() is called to enroll the student in all subscription-accessible courses.

Toggle Subscription Status

Flip a subscription between activa and cancelada with a single request.
PATCH /admin/subscriptions/{subscription}/toggle
No request body is required. When the model is saved, the SubscriptionObserver detects the status change and calls SubscriptionAccessService::sync() to immediately update the student’s course access — granting it if activated, revoking it if cancelled.

Delete Subscription

Permanently removes the subscription record from the database.
DELETE /admin/subscriptions/{subscription}
The SubscriptionObserver listens for the deleted Eloquent event and automatically revokes the student’s subscription-granted course access when the record is deleted.

Subscription Fields Reference

FieldTypeValues / Notes
user_idintegerForeign key to users
typestringtrimestral, semestral, or anual
start_datedateSet to now() when created by admin
end_datedateCalculated as start_date + months
statusenumactiva, cancelada, or expirada

Access Synchronization

Course access is never managed in isolation — it is always derived from subscription state:
  • SubscriptionObserver — fires on updated and deleted Eloquent events. Calls SubscriptionAccessService::sync() to reconcile the student’s enrollment flags (subscription_granted, subscription_active) with the current subscription status.
  • SubscriptionAccessService::grantAccess() — called on new subscriptions; creates enrollment records for all published subscription-accessible courses.
  • SubscriptionAccessService::sync() — called on toggles and deletes; activates or deactivates existing subscription-granted enrollments without touching permanently purchased ones.

Expiry Synchronization

Subscriptions past their end_date are not expired in real time — they are swept by a scheduled Artisan command:
php artisan subscriptions:sync-expired
This command queries for subscriptions with status = activa and end_date < now(), marks them as expirada, and revokes subscription-granted course access for all affected users.
The subscriptions:sync-expired command must be registered in the Laravel scheduler for automatic expiry to work. Verify your server’s crontab includes the Laravel scheduler entry:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Without this, expired subscriptions will not be marked automatically and students will retain access past their end date.
To manually resync all subscription-granted access across the platform — for example after importing data or bulk-updating records — run:
php artisan subscriptions:sync-access
This is safe to run at any time and will not affect permanently purchased course enrollments.

Build docs developers (and LLMs) love