Files
BarangaySystem/app/Support/SystemSettingsHelper.php
Jonathan Sykes fbb7e3ff37
Some checks failed
tests / PHP 8.2 (swoole-5.1.6) (push) Has been cancelled
tests / PHP 8.3 (swoole-5.1.6) (push) Has been cancelled
tests / PHP 8.4 (swoole-6.0) (push) Has been cancelled
feat: implement barangay system phases 2-14
Complete adaptation from BukidBountyApp to Philippine barangay governance:

- Barangay models: Resident, Household, HouseholdMember, Blotter, BlotterHearing,
  DocumentRequest, RequestPayment, RequestType, BarangayProject, BarangayBudget
- Controllers: ResidentController, HouseholdController, BlotterController,
  BlotterHearingController, DocumentRequestController, RequestTypeController,
  ProjectController, BudgetController, QRPHController, AdminConsoleController,
  UserController, FileController, ChapterController, LoginController
- Vue pages: Home, ManageResidents, ResidentProfile, ManageHouseholds, ManageBlotters,
  BlotterDetail, RequestDocument, ManageDocumentRequests, DocumentRequestDetail,
  ManageRequestTypes, ManageProjects, BudgetLedger, AdminConsole
- Barangay roles: PunongBarangay, Kagawad, Secretary, Treasurer, SK, Tanod, BHW, Staff, Resident
- UserPermissions matrix rewritten with barangay-specific permission mappings
- VueRouteMap replaced with barangay SPA routes
- UserActions enum references corrected across all controllers
- Removed all market/cooperative/POS/subscription code and models
2026-06-07 03:09:09 +08:00

116 lines
3.0 KiB
PHP

<?php
namespace App\Support;
use App\Models\SystemSetting;
use App\Http\Controllers\FilesMainController;
use App\Support\AccountingTheme;
class SystemSettingsHelper
{
/**
* Get application name.
*/
public static function appName(): string
{
return SystemSetting::getValue('app_name', 'BukidBounty');
}
/**
* Get application description.
*/
public static function appDescription(): string
{
return SystemSetting::getValue('app_description', 'Agricultural Management Platform & Marketplace');
}
/**
* Get application tagline.
*/
public static function appTagline(): string
{
return SystemSetting::getValue('app_tagline', 'Bounty of the Fields at Your Fingertips');
}
/**
* Get logo URL.
*/
public static function logoUrl(): string
{
$hashkey = SystemSetting::getValue('app_logo');
if ($hashkey) {
return FilesMainController::generateURLforFileListHash($hashkey);
}
return cdn_asset('vendor/assets/icons/192x192.png');
}
/**
* Get primary theme color.
*/
public static function primaryColor(): string
{
return SystemSetting::getValue('primary_color', '#0d6efd');
}
/**
* Get footer text.
*/
public static function footerText(): string
{
return SystemSetting::getValue('footer_text', '&copy; 2026 BukidBounty Ecosystem. All rights reserved.');
}
/**
* Check if maintenance mode is active.
*/
public static function isMaintenanceMode(): bool
{
return SystemSetting::getValue('maintenance_mode', false);
}
/**
* Get the application mode (corporate, cooperative, ngo, others).
*/
public static function appMode(): string
{
return SystemSetting::getValue('app_mode', 'corporate');
}
/**
* Get the hashkey of the main cooperative/organization (if any).
*/
public static function mainOrganizationHashkey(): ?string
{
$value = SystemSetting::getValue('main_organization');
return $value ?: null;
}
/**
* Get the barangay name from settings.
*/
public static function barangayName(): ?string
{
return static::get('barangay_name');
}
/**
* Get the active accounting theme key.
*/
public static function accountingTheme(): string
{
return SystemSetting::getValue('accounting_theme', AccountingTheme::DEFAULT_KEY);
}
/**
* Get available chapter/org position titles.
*/
public static function chapterPositions(): array
{
$value = SystemSetting::getValue('chapter_positions');
if (!$value) {
return ['National Director', 'Regional Director', 'Provincial Coordinator', 'City/Municipal Officer', 'Barangay Captain', 'Secretary', 'Treasurer', 'Auditor', 'Member'];
}
return is_string($value) ? (json_decode($value, true) ?? []) : (array) $value;
}
}