This is how I fixed the problem (using Gemini):
Technical Summary: Fixing SQL Error 1054 in Flarum
The Problem
After uninstalling the extension resofire/discussion-participants, the forum was unable to create new discussions, throwing a 500 Internal Server Error.
The error logs showed a QueryException:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'participant_count' in 'field list'
This happened because the extension's code (or a cached version of it) was still trying to update a database column that either didn't exist or was removed during the uninstallation process, but the "event listeners" remained active in the system.
The Solution
To fix this, we performed a manual database intervention to satisfy the missing requirement:
Database Patch: We manually added the missing column to the discussions table using the following SQL command:
SQL
ALTER TABLE fg_discussions ADD participant_count INT(10) UNSIGNED DEFAULT 0;
This immediately stopped the "Column not found" error by providing the field the application was looking for.
Service Cleanup:
We cleared the Flarum internal cache and restarted the web server services to ensure no "ghost" code from the extension remained in the PHP OPcache:
Bash
php flarum cache:clear
sudo systemctl restart apache2
Extension Removal:
We ensured the package was completely removed from the project dependencies:
Bash
composer remove resofire/discussion-participants
Result
The forum is now fully functional, and users can post new discussions without encountering the 500 Error.