# Afghan Online Education LMS update notes

## Added / updated

1. Front website homepage
   - Added Afghan Online Education branded hero section with logo, green/gold theme, student/teacher online learning visual, and clear Apply / Volunteer buttons.
   - Stored logo at `public/images/afghan-online-education/logo.png`.
   - Added reference design files under `docs/afghan-online-education/`.

2. Online application workflow
   - Admin application detail page now has:
     - `Create Student` button that opens the student form with application data pre-filled.
     - `Accept + Email` button.
     - `Reject + Email` button.
   - Student create form now accepts query-string prefill from application detail.

3. Email notification
   - Added `app/Mail/ApplicantStatusMail.php`.
   - Added email template `resources/views/emails/applicant-status.blade.php`.
   - Acceptance/rejection sends notification email when mail settings are configured.
   - If mail fails, the status update is still saved and the error is written to Laravel logs.

4. Volunteer workflow
   - Volunteer admin detail page now supports accept/reject with email notification.
   - Volunteer status can be filtered by query parameter.

5. Database review fields
   - Added migration `2026_06_11_000001_add_review_fields_to_online_forms.php` for:
     - `status_note`
     - `reviewed_by`
     - `reviewed_at`
   - Applies to `online_applications` and `volunteers` if those tables exist.

6. Route permissions / formation seeder
   - Added `database/seeders/RoutePermissionSeeder.php`.
   - It scans all named Laravel routes and creates Spatie permissions automatically.
   - Creates/updates roles: `Super Admin`, `Admin`, `student`, `teacher`.
   - Super Admin receives all permissions.
   - Admin receives all except role/permission management.
   - Student and teacher receive their portal permissions.

7. Page seeder
   - Added `database/seeders/AfghanOnlineEducationPageSeeder.php` for:
     - about-us
     - vision
     - mission
     - objective
     - online-education

## Run after upload

```bash
composer install
php artisan key:generate
php artisan storage:link
php artisan migrate
php artisan db:seed --class=RoutePermissionSeeder
php artisan db:seed --class=AfghanOnlineEducationPageSeeder
php artisan optimize:clear
```

For email notifications, configure `.env` mail settings, for example `MAIL_MAILER`, `MAIL_HOST`, `MAIL_PORT`, `MAIL_USERNAME`, `MAIL_PASSWORD`, and `MAIL_FROM_ADDRESS`.

## Checked

- PHP syntax checked for new/changed controllers, mail class, migration and seeders.
- `php artisan route:list` completed successfully.
