ghassan 0b2e95ea65 Add NAS file manager integration and all pending platform changes
- Installed p7h/nas-file-manager package via private VCS repo
- Published config/nas-file-manager.php with super_admin middleware restriction
- Added NAS env vars to .env.example
- Created admin/nas-storage page with connection info panel and file browser widget
- Added NAS Storage link to admin sidebar (super_admin only)
- Added SuperAdminController@nasStorage method and admin.nas-storage route
- Includes all accumulated branch changes: profile wall, 2FA, audit logs,
  settings panel, country/phone/timezone components, posts, slideshow,
  playlist shares, video downloads/shares, comment likes, notifications,
  social links, and more

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:24:32 +03:00

102 lines
4.6 KiB
PHP

<?php
namespace App\Helpers;
class Horoscope
{
private static array $signs = [
['name' => 'Capricorn', 'symbol' => '♑', 'element' => 'Earth', 'emoji' => '🐐', 'from' => [12, 22], 'to' => [1, 19],
'traits' => ['Ambitious', 'Disciplined', 'Patient', 'Practical']],
['name' => 'Aquarius', 'symbol' => '♒', 'element' => 'Air', 'emoji' => '🏺', 'from' => [1, 20], 'to' => [2, 18],
'traits' => ['Independent', 'Progressive', 'Humanitarian', 'Inventive']],
['name' => 'Pisces', 'symbol' => '♓', 'element' => 'Water', 'emoji' => '🐟', 'from' => [2, 19], 'to' => [3, 20],
'traits' => ['Empathetic', 'Creative', 'Intuitive', 'Gentle']],
['name' => 'Aries', 'symbol' => '♈', 'element' => 'Fire', 'emoji' => '🐏', 'from' => [3, 21], 'to' => [4, 19],
'traits' => ['Courageous', 'Energetic', 'Enthusiastic', 'Bold']],
['name' => 'Taurus', 'symbol' => '♉', 'element' => 'Earth', 'emoji' => '🐂', 'from' => [4, 20], 'to' => [5, 20],
'traits' => ['Reliable', 'Patient', 'Devoted', 'Sensual']],
['name' => 'Gemini', 'symbol' => '♊', 'element' => 'Air', 'emoji' => '👥', 'from' => [5, 21], 'to' => [6, 20],
'traits' => ['Adaptable', 'Curious', 'Witty', 'Expressive']],
['name' => 'Cancer', 'symbol' => '♋', 'element' => 'Water', 'emoji' => '🦀', 'from' => [6, 21], 'to' => [7, 22],
'traits' => ['Caring', 'Protective', 'Intuitive', 'Emotional']],
['name' => 'Leo', 'symbol' => '♌', 'element' => 'Fire', 'emoji' => '🦁', 'from' => [7, 23], 'to' => [8, 22],
'traits' => ['Confident', 'Dramatic', 'Creative', 'Generous']],
['name' => 'Virgo', 'symbol' => '♍', 'element' => 'Earth', 'emoji' => '🌾', 'from' => [8, 23], 'to' => [9, 22],
'traits' => ['Analytical', 'Loyal', 'Practical', 'Diligent']],
['name' => 'Libra', 'symbol' => '♎', 'element' => 'Air', 'emoji' => '⚖️', 'from' => [9, 23], 'to' => [10, 22],
'traits' => ['Diplomatic', 'Gracious', 'Fair-minded', 'Social']],
['name' => 'Scorpio', 'symbol' => '♏', 'element' => 'Water', 'emoji' => '🦂', 'from' => [10, 23], 'to' => [11, 21],
'traits' => ['Passionate', 'Stubborn', 'Resourceful', 'Brave']],
['name' => 'Sagittarius','symbol' => '♐', 'element' => 'Fire', 'emoji' => '🏹', 'from' => [11, 22], 'to' => [12, 21],
'traits' => ['Optimistic', 'Adventurous', 'Honest', 'Philosophical']],
];
private static array $elementCompatibility = [
'Fire' => ['Fire' => 85, 'Air' => 80, 'Earth' => 45, 'Water' => 40],
'Earth' => ['Earth' => 88, 'Water' => 82, 'Fire' => 45, 'Air' => 50],
'Air' => ['Air' => 84, 'Fire' => 80, 'Water' => 48, 'Earth' => 50],
'Water' => ['Water' => 86, 'Earth' => 82, 'Fire' => 40, 'Air' => 48],
];
public static function getSign(?string $birthday): ?array
{
if (! $birthday) return null;
try {
$date = new \DateTime($birthday);
} catch (\Exception) {
return null;
}
$month = (int) $date->format('n');
$day = (int) $date->format('j');
foreach (self::$signs as $sign) {
[$fm, $fd] = $sign['from'];
[$tm, $td] = $sign['to'];
if ($fm > $tm) {
// Capricorn wraps year
if (($month === $fm && $day >= $fd) || ($month === $tm && $day <= $td)) {
return $sign;
}
} else {
if (($month === $fm && $day >= $fd) || ($month > $fm && $month < $tm) || ($month === $tm && $day <= $td)) {
return $sign;
}
}
}
return null;
}
public static function compatibility(?array $sign1, ?array $sign2): ?int
{
if (! $sign1 || ! $sign2) return null;
$base = self::$elementCompatibility[$sign1['element']][$sign2['element']] ?? 50;
// Same sign bonus
if ($sign1['name'] === $sign2['name']) {
$base = min(98, $base + 8);
}
// Deterministic jitter so different sign pairs within same element feel unique
$seed = crc32($sign1['name'] . ':' . $sign2['name']);
$jitter = (abs($seed) % 11) - 5;
return max(20, min(99, $base + $jitter));
}
public static function elementColor(string $element): string
{
return match ($element) {
'Fire' => '#ff6b35',
'Earth' => '#6abf69',
'Air' => '#64b5f6',
'Water' => '#4fc3f7',
default => '#aaa',
};
}
}