migrant-web/app/Http/Controllers/Employer/WorkerController.php
2026-05-15 17:40:21 +05:30

169 lines
6.8 KiB
PHP

<?php
namespace App\Http\Controllers\Employer;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Inertia\Inertia;
class WorkerController extends Controller
{
private function getWorkersList()
{
return [
[
'id' => 101,
'name' => 'Maria Santos',
'nationality' => 'Philippines',
'category' => 'Childcare',
'skills' => ['Childcare', 'Cooking', 'Housekeeping', 'Ironing'],
'availability' => 'Immediate',
'experience' => '5+ Years',
'experience_years' => 6,
'salary' => 1800,
'religion' => 'Christian',
'languages' => ['English', 'Tagalog'],
'age' => 32,
'verified' => true,
'bio' => 'Experienced nanny with 6 years working with expatriate families in Dubai. Certified in pediatric first aid.',
],
[
'id' => 102,
'name' => 'Lakshmi Sharma',
'nationality' => 'India',
'category' => 'Elderly Care',
'skills' => ['Elderly Care', 'Cooking', 'Medication Management'],
'availability' => '2 Weeks',
'experience' => '3-5 Years',
'experience_years' => 4,
'salary' => 1600,
'religion' => 'Hindu',
'languages' => ['English', 'Hindi'],
'age' => 38,
'verified' => true,
'bio' => 'Patient caregiver specializing in elderly assistance, mobility support, and vegetarian cooking.',
],
[
'id' => 103,
'name' => 'Siti Aminah',
'nationality' => 'Indonesia',
'category' => 'Housekeeping',
'skills' => ['Housekeeping', 'Ironing', 'Deep Cleaning'],
'availability' => 'Immediate',
'experience' => '3-5 Years',
'experience_years' => 3,
'salary' => 1400,
'religion' => 'Muslim',
'languages' => ['English', 'Arabic'],
'age' => 29,
'verified' => true,
'bio' => 'Hardworking and meticulous housekeeper with excellent references from Abu Dhabi households.',
],
[
'id' => 104,
'name' => 'Grace Osei',
'nationality' => 'Ghana',
'category' => 'Childcare',
'skills' => ['Childcare', 'English Tutoring', 'Cooking'],
'availability' => '1 Month',
'experience' => '1-2 Years',
'experience_years' => 2,
'salary' => 1500,
'religion' => 'Christian',
'languages' => ['English'],
'age' => 26,
'verified' => false,
'bio' => 'Energetic and educated nanny. Fluent in English, great with toddlers and assisting with homework.',
],
[
'id' => 105,
'name' => 'Anoma Perera',
'nationality' => 'Sri Lanka',
'category' => 'Cooking',
'skills' => ['Cooking', 'Baking', 'Housekeeping'],
'availability' => 'Immediate',
'experience' => '5+ Years',
'experience_years' => 8,
'salary' => 2200,
'religion' => 'Buddhist',
'languages' => ['English', 'Arabic'],
'age' => 41,
'verified' => true,
'bio' => 'Professional domestic cook skilled in Arabic, Continental, and Asian cuisine. Highly organized.',
],
[
'id' => 106,
'name' => 'Mary Wanjiku',
'nationality' => 'Kenya',
'category' => 'Housekeeping',
'skills' => ['Housekeeping', 'Laundry', 'Pet Care'],
'availability' => '1 Week',
'experience' => '1-2 Years',
'experience_years' => 2,
'salary' => 1300,
'religion' => 'Christian',
'languages' => ['English'],
'age' => 25,
'verified' => true,
'bio' => 'Enthusiastic and animal-loving housekeeper. Extremely reliable and quick learner.',
],
[
'id' => 107,
'name' => 'Fatima Zahra',
'nationality' => 'Ethiopia',
'category' => 'Housekeeping',
'skills' => ['Housekeeping', 'Arabic Cooking', 'Baby Care'],
'availability' => 'Immediate',
'experience' => '3-5 Years',
'experience_years' => 5,
'salary' => 1500,
'religion' => 'Muslim',
'languages' => ['Arabic', 'English'],
'age' => 31,
'verified' => true,
'bio' => 'Fluent Arabic speaker with 5 years experience in Al Ain. Excellent at traditional Arabic dishes.',
],
[
'id' => 108,
'name' => 'Ramesh Thapa',
'nationality' => 'Nepal',
'category' => 'Driver',
'skills' => ['Family Driver', 'Garden Maintenance', 'Heavy Lifting'],
'availability' => '2 Weeks',
'experience' => '5+ Years',
'experience_years' => 7,
'salary' => 2500,
'religion' => 'Hindu',
'languages' => ['English', 'Hindi'],
'age' => 36,
'verified' => true,
'bio' => 'Valid UAE driving license with clean record. Familiar with all Dubai and Sharjah school routes.',
],
];
}
public function index(Request $request)
{
return Inertia::render('Employer/Workers/Index', [
'initialWorkers' => $this->getWorkersList(),
'filtersMetadata' => [
'categories' => ['All Categories', 'Childcare', 'Housekeeping', 'Cooking', 'Elderly Care', 'Driver'],
'nationalities' => ['All Nationalities', 'Philippines', 'India', 'Indonesia', 'Sri Lanka', 'Nepal', 'Ethiopia', 'Kenya', 'Ghana'],
'availabilities' => ['All Availabilities', 'Immediate', '1 Week', '2 Weeks', '1 Month'],
'experienceLevels' => ['All Experience', '1-2 Years', '3-5 Years', '5+ Years'],
'religions' => ['All Religions', 'Christian', 'Muslim', 'Hindu', 'Buddhist'],
]
]);
}
public function show($id)
{
$workers = $this->getWorkersList();
$worker = collect($workers)->firstWhere('id', (int)$id) ?? $workers[0];
return Inertia::render('Employer/Workers/Show', [
'worker' => $worker,
]);
}
}