Location: app/Http/Controllers/Web/UsersController.php - doRegister() method
- New users automatically receive the 'exstudent' role upon registration
- Implementation:
$user->assignRole('exstudent');
Location: resources/views/grades/list.blade.php
- Added "Appeal Status" column visible to users with
show_exgradespermission - Displays detailed status with timestamps and reasons:
- 🔘 No Appeal (none)
⚠️ Pending (with reason and submission time)- ✅ Approved (with response and approval time)
- ❌ Rejected (with response and rejection time)
- ℹ️ Appeal Closed (when grade is modified)
Location: resources/views/grades/list.blade.php
- Appeal button appears for students on their own grades (when status is 'none')
- Modal form allows students to submit detailed appeal reasons
- Protected by
submit_grade_appealpermission
Location: Multiple files
- View: Enhanced status display shows response text and timestamps
- Controller:
GradesController@respondToAppeal()handles teacher responses - Modal: Teacher response form with approval/rejection options
Location: resources/views/users/profile.blade.php & app/Http/Controllers/Web/UsersController.php
- Profile displays all user permissions (direct + role-based)
- Shows permissions as green badges with readable names
- Comprehensive permission aggregation from roles and direct assignments
Location: app/Http/Controllers/Web/GradesController.php - save() method
- Detects when grade is modified
- Automatically sets appeal_status to 'closed' for active appeals
- Prevents stale appeals on modified grades
appeal_status ENUM('none', 'pending', 'approved', 'rejected', 'closed') DEFAULT 'none'
appeal_reason TEXT NULL
appealed_at TIMESTAMP NULL
appeal_response TEXT NULL
appeal_responded_at TIMESTAMP NULLsubmit_grade_appeal- Students can submit appealsrespond_to_grade_appeal- Teachers can respond to appealsview_grade_appeals- View appeal status information
- exstudent role:
submit_grade_appeal - exteacher role:
respond_to_grade_appeal,view_grade_appeals - exmanager role:
respond_to_grade_appeal,view_grade_appeals
Route::post('/grades/{grade}/appeal', [GradesController::class, 'submitAppeal'])->name('grades_appeal_submit');
Route::post('/grades/{grade}/respond', [GradesController::class, 'respondToAppeal'])->name('grades_appeal_respond');- Appeal Status Column: Color-coded badges with detailed information
- Appeal Button: Students can appeal their grades
- Respond Button: Teachers can respond to pending appeals
- Modal Forms: User-friendly forms for appeals and responses
- Permissions Display: Shows all user permissions as badges
- Role Information: Clear display of assigned roles
- Created comprehensive test script (
test_final_implementation.php) - Verified all database schema changes
- Confirmed permission assignments
- Tested appeal workflow
- ✅ Server running on localhost:8000
- ✅ All routes accessible
- ✅ UI components render correctly
- ✅ Permission system enforced
app/Http/Controllers/Web/UsersController.php- Auto-role assignmentapp/Http/Controllers/Web/GradesController.php- Appeal functionality
resources/views/grades/list.blade.php- Appeal UI componentsresources/views/users/profile.blade.php- Permission display (existing)
database/migrations/2025_06_01_073124_add_appeal_functionality_to_grades_table.phpdatabase/migrations/2025_06_01_074841_update_appeal_status_enum_add_closed.phpdatabase/seeders/AppealPermissionsSeeder.php
app/Models/Grade.php- Added appeal fields to fillable and casts
routes/web.php- Added appeal routes
All six requirements have been successfully implemented with:
- ✅ Robust permission system
- ✅ Comprehensive UI components
- ✅ Database schema integrity
- ✅ Proper error handling
- ✅ Security controls
- ✅ User-friendly interfaces
The Laravel permission-based role system now fully supports grade appeals with complete teacher-student interaction workflows.