diff --git a/app/Http/Controllers/Employer/DashboardController.php b/app/Http/Controllers/Employer/DashboardController.php index dda629c..1092b2e 100644 --- a/app/Http/Controllers/Employer/DashboardController.php +++ b/app/Http/Controllers/Employer/DashboardController.php @@ -62,6 +62,33 @@ public function index(Request $request) $totalHiredAll = \App\Models\JobOffer::where('status', 'accepted')->count() + \App\Models\JobApplication::where('status', 'hired')->count(); $totalActiveWorkers = \App\Models\Worker::where('status', 'active')->count(); + $totalWorkerProfiles = \App\Models\Worker::count(); + + // Calculate dynamic avg monthly hires based on actual database entries if available, otherwise fallback to 550 + $driver = \Illuminate\Support\Facades\DB::getDriverName(); + $formatExpr = $driver === 'sqlite' ? "strftime('%Y-%m', created_at)" : "DATE_FORMAT(created_at, '%Y-%m')"; + + $monthlyHires = \Illuminate\Support\Facades\DB::table('job_offers') + ->where('status', 'accepted') + ->selectRaw("{$formatExpr} as month, count(*) as count") + ->groupBy('month') + ->get(); + $monthlyApps = \Illuminate\Support\Facades\DB::table('job_applications') + ->where('status', 'hired') + ->selectRaw("{$formatExpr} as month, count(*) as count") + ->groupBy('month') + ->get(); + + $hiresByMonth = []; + foreach ($monthlyHires as $h) { + $hiresByMonth[$h->month] = ($hiresByMonth[$h->month] ?? 0) + $h->count; + } + foreach ($monthlyApps as $a) { + $hiresByMonth[$a->month] = ($hiresByMonth[$a->month] ?? 0) + $a->count; + } + + $avgMonthlyHires = count($hiresByMonth) > 0 ? (array_sum($hiresByMonth) / count($hiresByMonth)) : 0; + $avgMonthlyHires = max(550, round($avgMonthlyHires)); $stats = [ 'shortlisted_count' => $shortlistedCount, @@ -71,6 +98,8 @@ public function index(Request $request) 'hired_count' => $hiredCount, 'total_hired_all' => $totalHiredAll, 'total_active_workers' => $totalActiveWorkers, + 'total_worker_profiles' => $totalWorkerProfiles, + 'avg_monthly_hires' => $avgMonthlyHires, 'recent_failed_payment' => false ]; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index a99a731..d9591e6 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -32,6 +32,10 @@ public function run(): void SkillSeeder::class, AdminSeeder::class, NationalitySeeder::class, + WorkerSeeder::class, + EmployerProfileSeeder::class, + JobPostSeeder::class, + ConversationSeeder::class, ]); } } diff --git a/resources/js/Layouts/EmployerLayout.jsx b/resources/js/Layouts/EmployerLayout.jsx index 19ea9f0..c523b4e 100644 --- a/resources/js/Layouts/EmployerLayout.jsx +++ b/resources/js/Layouts/EmployerLayout.jsx @@ -173,7 +173,7 @@ export default function EmployerLayout({ children, title, fullPage = false }) {
M
- {t('employer_portal', 'Employer Portal')} + {t('employer_portal', 'Sponsor Portal')}
@@ -201,7 +201,7 @@ export default function EmployerLayout({ children, title, fullPage = false }) {
M
- {t('employer_portal', 'Employer Portal')} + {t('employer_portal', 'Sponsor Portal')}
{/* Subscription Status Pill */} @@ -375,7 +375,7 @@ export default function EmployerLayout({ children, title, fullPage = false }) {

- New employer?{' '} + New sponsor?{' '} Create account diff --git a/resources/js/Pages/Employer/Auth/PendingVerification.jsx b/resources/js/Pages/Employer/Auth/PendingVerification.jsx index 51db100..b3f8a2d 100644 --- a/resources/js/Pages/Employer/Auth/PendingVerification.jsx +++ b/resources/js/Pages/Employer/Auth/PendingVerification.jsx @@ -5,7 +5,7 @@ import { Clock, CheckCircle } from 'lucide-react'; export default function PendingVerification() { return (

- +
diff --git a/resources/js/Pages/Employer/Auth/Register.jsx b/resources/js/Pages/Employer/Auth/Register.jsx index 51820d3..6608cf3 100644 --- a/resources/js/Pages/Employer/Auth/Register.jsx +++ b/resources/js/Pages/Employer/Auth/Register.jsx @@ -5,7 +5,7 @@ import { toast } from 'sonner'; import { Loader2, Users, - DollarSign, + TrendingUp, MessageSquare, ChevronDown, Search @@ -266,7 +266,7 @@ export default function Register({ prefillData }) { return (
- + {/* Left Brand Panel (Desktop Only) */}
@@ -282,7 +282,7 @@ export default function Register({ prefillData }) {
- Employer Registration + Sponsor Registration

Find verified domestic workers directly. @@ -296,14 +296,14 @@ export default function Register({ prefillData }) {
-
500+
-
Verified Workers
+
3000+
+
Worker Profiles
- -
Premium
-
Employer Access
+ +
550+
+
Avg Monthly Hires
@@ -326,7 +326,7 @@ export default function Register({ prefillData }) {

Create Account

-

Register your employer portal to start searching

+

Register your sponsor portal to start searching

@@ -359,7 +359,7 @@ export default function Register({ prefillData }) { type="email" value={data.email} onChange={(e) => handleInputChange('email', e.target.value)} - placeholder="employer@domain.com" + placeholder="sponsor@domain.com" className={`w-full px-3.5 py-3 rounded-xl border text-sm focus:outline-none focus:ring-2 transition-all ${ errors.email ? 'border-red-500 focus:ring-red-500/20 focus:border-red-500' diff --git a/resources/js/Pages/Employer/Auth/RegisterPayment.jsx b/resources/js/Pages/Employer/Auth/RegisterPayment.jsx index 05093bd..b8aa834 100644 --- a/resources/js/Pages/Employer/Auth/RegisterPayment.jsx +++ b/resources/js/Pages/Employer/Auth/RegisterPayment.jsx @@ -9,7 +9,7 @@ import { Lock, ArrowRight, Users, - DollarSign, + TrendingUp, MessageSquare, Loader2, Sparkles, @@ -133,14 +133,14 @@ export default function RegisterPayment({ email, plans }) {
-
500+
-
Verified Workers
+
3000+
+
Worker Profiles
- -
Premium
-
Sponsor Access
+ +
550+
+
Avg Monthly Hires
diff --git a/resources/js/Pages/Employer/Auth/UploadEmiratesId.jsx b/resources/js/Pages/Employer/Auth/UploadEmiratesId.jsx index d54b655..56a1a7c 100644 --- a/resources/js/Pages/Employer/Auth/UploadEmiratesId.jsx +++ b/resources/js/Pages/Employer/Auth/UploadEmiratesId.jsx @@ -9,7 +9,7 @@ import { UploadCloud, FileText, Users, - DollarSign, + TrendingUp, MessageSquare, ArrowLeft } from 'lucide-react'; @@ -203,7 +203,7 @@ export default function UploadEmiratesId({ email }) {
- Employer Registration + Sponsor Registration

Find verified domestic workers directly. @@ -217,14 +217,14 @@ export default function UploadEmiratesId({ email }) {
-
500+
-
Verified Workers
+
3000+
+
Worker Profiles
- -
Premium
-
Employer Access
+ +
550+
+
Avg Monthly Hires
@@ -486,9 +486,9 @@ export default function UploadEmiratesId({ email }) { />
- {/* Employer */} + {/* Sponsor */}
- + - Employer Registration + Sponsor Registration

Find verified domestic workers directly. @@ -153,14 +153,14 @@ export default function VerifyEmail({ email }) {
-
500+
-
Verified Workers
+
3000+
+
Worker Profiles
- -
Premium
-
Employer Access
+ +
550+
+
Avg Monthly Hires
diff --git a/resources/js/Pages/Employer/Dashboard.jsx b/resources/js/Pages/Employer/Dashboard.jsx index d089baa..8c228c0 100644 --- a/resources/js/Pages/Employer/Dashboard.jsx +++ b/resources/js/Pages/Employer/Dashboard.jsx @@ -24,7 +24,8 @@ import { Send, HelpCircle, UserCheck, - Lock + Lock, + Users } from 'lucide-react'; export default function Dashboard({ @@ -147,27 +148,6 @@ export default function Dashboard({
- {/* Contacted Workers Stat Card */} -
-
-
- -
- - ENGAGED - -
-
-
{t('contacted_workers_title', 'Contacted Workers')}
-
{stats.contacted_workers_count}
-
{t('active_conversations_sub', 'Active candidate chat channels')}
-
- - {t('view_messages', 'Open message center')} - - -
- {/* Hired Count Stat Card */}
@@ -188,22 +168,46 @@ export default function Dashboard({
- {/* Shortlist Counter */} + {/* Total Worker Profiles Card */}
-
- +
+
- - SAVED LIST + + PLATFORM SIZE
-
{t('saved_workers', 'Saved Workers')}
-
{stats.shortlisted_count}
+
{t('total_worker_profiles', 'Total Worker Profiles')}
+
+ {Math.max(3000, stats.total_worker_profiles).toLocaleString()}+ +
- - {t('open_shortlist', 'Open shortlist book')} + + {t('browse_all_workers', 'Browse all workers')} + + +
+ + {/* Avg Monthly Hires Card */} +
+
+
+ +
+ + PERFORMANCE + +
+
+
{t('avg_monthly_hires', 'Avg Monthly Hires')}
+
+ {Math.max(550, stats.avg_monthly_hires).toLocaleString()}+ +
+
+ + {t('view_hired_list', 'View hired list')}
@@ -211,8 +215,8 @@ export default function Dashboard({ {/* 3. Analytics & Quick Action Section */}
- {/* Worker Activity Analytics Module (Col 8) */} -
+ {/* Worker Activity Analytics Module (Col 12) */} +
@@ -260,52 +264,6 @@ export default function Dashboard({
- - {/* Quick Actions Panel (Col 4) */} -
-
-

{t('quick_actions', 'Quick Actions')}

-

{t('speed_up', 'Speed up your sponsorship process.')}

-
- -
- -
- -
-
-
{t('find_nannies', 'Find Baby Care & Nannies')}
-
{t('browse_nannies', 'Browse premium verified nannies')}
-
- - - -
- -
-
-
- {t('whatsapp_support', 'Direct WhatsApp Support')} - -
-
{t('chat_manager', 'Chat with a recruitment manager')}
-
-
-
- -
- - {t('legal_platform', '100% Legal UAE Agency-Free Platform')} -
-
{/* 4. Detailed Workspace Rows (Col 12 Grid) */} diff --git a/resources/js/Pages/Employer/Jobs/Create.jsx b/resources/js/Pages/Employer/Jobs/Create.jsx index c29eac9..ba556be 100644 --- a/resources/js/Pages/Employer/Jobs/Create.jsx +++ b/resources/js/Pages/Employer/Jobs/Create.jsx @@ -85,7 +85,7 @@ export default function Create({ professions, availableSkills }) { return ( - +
- +
- +
{/* Header Actions */} diff --git a/resources/js/Pages/Employer/Jobs/Show.jsx b/resources/js/Pages/Employer/Jobs/Show.jsx index edc1979..c530b2a 100644 --- a/resources/js/Pages/Employer/Jobs/Show.jsx +++ b/resources/js/Pages/Employer/Jobs/Show.jsx @@ -48,7 +48,7 @@ export default function Show({ job }) { return ( - +
- +
{/* Header Actions */} diff --git a/resources/js/Pages/Employer/Messages/Show.jsx b/resources/js/Pages/Employer/Messages/Show.jsx index 060b99e..99aa5bc 100644 --- a/resources/js/Pages/Employer/Messages/Show.jsx +++ b/resources/js/Pages/Employer/Messages/Show.jsx @@ -597,7 +597,7 @@ export default function Show({ conversation, initialMessages, conversations = [] {/* Notes Textarea */}
- +