| Current Path : /var/www/html/reddsis_bak_20260901/ |
| Current File : /var/www/html/reddsis_bak_20260901/AGENTS.md~ |
# REDD+ Dev Project Knowledge ## Project Structure - **Laravel app** at `C:\laragon\www\dynaweb4\dev new\redd-plus-dev` - **Database**: MySQL, configured in `.env` - **Admin panel**: Tailadmin theme, CSS at `public/tailadmin/src/css/style.css` ## Frontend Theme (REDD+ portal) CSS variables defined in: `database/seeders/redd-plus/ReddPlusSiteLayoutSeeder.php` ``` --green-900: #22392a --green-800: #2e4a35 --green-700: #3d5c44 --green-200: #cddac9 --green-100: #e4ecdf --gold: #b9975b --cream: #f7f5ee (body background) --ink: #3a4a3f (text color) --card-bg: #ffffff (card background, recently added) ``` ## Info Card Styling - `.info-card` CSS is embedded inline in article content stored in DB - Defined in seeders: - `database/seeders/redd-plus/ReddPlusArticleSeeder.php` (articles with info-card HTML) - `database/seeders/redd-plus/ReddPlusPageSeeder.php` (pages with info-card HTML) - Also in cached view files under `storage/framework/views/` (auto-regenerated) - Recent update (2026-07-29): strengthened card with white bg, stronger border `#d8d4c8`, added `box-shadow` ## Database Tables - `content_article` - articles (PK: `article_id`) - `content_article_translation` - translations including HTML content (`article_translation_content`) - `theme_rules` / `theme_settings` - dynamic theme configuration - `settings` - key-value app settings (sidebar colors, etc.) - `data_dashboard` - dashboard widgets - `frontend_sites` - site layouts (header, footer, layout HTML) ## Key Models - `app/Models/Backend/ContentArticle.php` - article model, hasMany translations - `app/Models/Backend/ContentArticleTranslation.php` - translation model - `app/Models/Backend/ThemeSetting.php` / `ThemeRule.php` - theme config - `app/Models/Backend/Setting.php` - key-value settings - `app/Models/Backend/FrontendSite.php` - frontend sites ## Article ID Mapping & Translation Lookup - URL `?id=<article_code>` maps to `content_article.article_code`. - Translation rows are linked by `content_article_translation.article_translation_parent_id` → `content_article.article_id`. - Not all articles have both `en` and `ms` translations. The frontend may fall back to whichever translation exists. - Key REDD+ article IDs: - `stakeholder-engagement` → `article_id = 49` (translation id 146, `en`) - `forest-governance` → `article_id = 68` (translation id 153, `ms`) - `governance` → `article_id = 50` ## Content Editing Notes - Article content is full HTML stored in `content_article_translation.article_translation_content`. - Custom article styles (e.g., `.feature-card`, `.stake-card`, `.info-card`) are embedded as inline `<style>` blocks inside the article content. - Some images in article content are hosted externally (`https://redd.nres.gov.my/wp-content/uploads/...`). - After editing article content, run `php artisan cache:clear` and `php artisan view:clear` to refresh the rendered page. ## Tinker Tips - When using `php artisan tinker --execute="..."`, use single backslashes for namespaces: `App\Models\Backend\ContentArticle`. - Do not double-escape backslashes (`\\`) in the execute argument. ## Key Controllers - `app/Http/Controllers/Backend/ContentArticleController.php` - article CRUD ## Helpers - `app/Http/Helpers/SettingHelper.php` - `get()`/`set()` for settings with cache - `app/Helpers/DashboardHelper.php` - `render()` for dashboard widgets ## Migrations - Article tables: `2026_05_13_142707_create_content_article_table.php`, `2026_05_13_142708_create_content_article_translation_table.php` - Theme: `2026_07_01_000001_create_theme_tables.php` - Settings: `2026_06_18_154226_create_settings_table.php` - Dashboard: `2026_05_21_045007_create_data_dashboard_table.php`