# Backend Retest — Laravel 12 Phases 1–12

## Scope and test method
Reviewed the supplied source overlay. PHP CLI syntax validation and static checks are run against the package. This environment has PHP but no Composer, installed Laravel framework/vendor directory, or running MySQL database. **End-to-end Laravel/MySQL/browser tests have not been executed.**

## Changes in this audited version
- Removed ordinary-admin write access to site-wide settings; only super_admin can update settings.
- Added explicit analytics permission for ordinary administrators.
- Prevented ordinary administrators from assigning admin roles or editing/deleting peer administrators.
- Blocked premium video view events unless the viewer passes the entitlement check.
- Blocked view events for disabled live events.
- Added collision/empty checks for auto-generated category and video slugs.

## Important remaining risks and work
1. This ZIP is a Laravel **source overlay**, not a complete runnable application: requires a fresh Laravel 12 skeleton, Composer install, configured .env and database.
2. Publicly stored uploaded videos are accessible through public URLs even if marked premium. Do not sell subscriptions until private/signed streaming delivery is implemented.
3. External streaming links are not validated for reachability, CORS, codec, or token expiry.
4. Upload and database changes are not transactional as a unit; failed DB writes can leave orphaned files.
5. Concurrent EPG scheduling can still race; add locking/constraint strategy.
6. User analytics are session-based, not verified player analytics.
7. Roles are hard-coded rather than a full granular permissions system.
8. Complete integration testing must include migrations, login, every CRUD operation, authorization, uploads, subscriptions, EPG, and frontend flows.

## Installation
Back up existing application and MySQL database. Merge this overlay into a clean Laravel 12 installation. Set MySQL .env credentials and initial admin credentials as documented in README.md. Run `php artisan migrate`, `php artisan storage:link`, and `php artisan db:seed --class=AdminUserSeeder` (first install only). Remove initial admin password from .env after seeding.
