# Phase 5: Enrollment & Payment Admin

## Enrollments `/admin/enrollments`
Constructed the `Admin\EnrollmentController` enabling full manual mapping of Users to published Courses.
- **Manual Overrides**: Admins have the ability to explicitly set `expires_at` via a standard HTML datepicker. Leaving the field blank maps to `null` on the backend, signifying "Lifetime Access".
- **States**: Enrollments are controlled strictly via `active`, `expired`, and `cancelled` states.

## Payments Ledger `/admin/payments`
Constructed a strictly Read-Only ledger pointing to `Admin\PaymentController@index`.
- This interface abstracts the `payments` table and joins course title and user name.
- It displays exact timestamps and gateway identifiers (e.g. tracking `transaction_id` from external Stripe/EasyPaisa providers generated in future phases).

## Global Configuration `/admin/settings`
Instead of relying purely on `.env` modifications or rigid DB tables, we implemented a generic `settings` table mapping `key` and `value`.
- **Flexible UI**: `Admin\SettingController` leverages `updateOrCreate` against keys submitted via the admin form.
- Keys currently tracked: `site_name`, `contact_email`, `contact_phone`, `currency`, `allow_registrations`.
- Abstracting settings to the database allows non-dev admins to completely brand the platform without diving into configuration code.

## Next Steps
Data structure, User administration, Course cataloging, and Enrollment handling are structurally completed. We should now shift to visualizing this data. Proceed to **Phase 6: Admin Analytics Dashboard**.
