From ca3f5fe67d78ffac2664fef5cd265763add657ad Mon Sep 17 00:00:00 2001 From: sagar1862000 <2000sagarsharma@gmail.com> Date: Thu, 12 Dec 2024 12:29:47 +0530 Subject: [PATCH] issues resolved --- .../CodeTrek/Entities/CodeTrekApplicant.php | 5 ----- .../Http/Controllers/CodeTrekController.php | 4 ---- .../CodeTrek/Resources/views/index.blade.php | 1 - .../Prospect/Resources/views/create.blade.php | 7 +++--- app/Http/Controllers/HomeController.php | 22 +++++-------------- 5 files changed, 9 insertions(+), 30 deletions(-) diff --git a/Modules/CodeTrek/Entities/CodeTrekApplicant.php b/Modules/CodeTrek/Entities/CodeTrekApplicant.php index b31b0c2544..7543889a56 100644 --- a/Modules/CodeTrek/Entities/CodeTrekApplicant.php +++ b/Modules/CodeTrek/Entities/CodeTrekApplicant.php @@ -24,11 +24,6 @@ public static function factory() return new CodeTrekApplicantFactory(); } - // public function center() - // { - // return $this->belongsTo(OfficeLocation::class, 'center_id'); - // } - public function getDaysInCodetrekAttribute() { $internshipStartDate = Carbon::parse($this->internship_start_date); diff --git a/Modules/CodeTrek/Http/Controllers/CodeTrekController.php b/Modules/CodeTrek/Http/Controllers/CodeTrekController.php index 2a3355edd5..0290a19983 100644 --- a/Modules/CodeTrek/Http/Controllers/CodeTrekController.php +++ b/Modules/CodeTrek/Http/Controllers/CodeTrekController.php @@ -27,7 +27,6 @@ public function index(Request $request) { // $this->authorize('view', $applicant); There are some issues in the production, which is why these lines are commented out. - // $centres = OfficeLocation::all(); $mentors = User::all(); $applicantData = $this->service->getCodeTrekApplicants($request->all()); $applicants = $applicantData['applicants']; @@ -40,7 +39,6 @@ public function index(Request $request) return view('codetrek::index', [ 'applicants' => $applicants, - // 'centres' => $centres, 'mentors' => $mentors, 'reportApplicationCounts' => $reportApplicationCounts, 'statusCounts' => $statusCounts, @@ -77,8 +75,6 @@ public function edit(CodeTrekApplicant $applicant) { // $this->authorize('update', $applicant); There are some issues in the production, which is why these lines are commented out. - // $centres = OfficeLocation::all(); - $mentors = User::all(); $this->service->edit($applicant); diff --git a/Modules/CodeTrek/Resources/views/index.blade.php b/Modules/CodeTrek/Resources/views/index.blade.php index 8ef52241eb..b2b7f64423 100644 --- a/Modules/CodeTrek/Resources/views/index.blade.php +++ b/Modules/CodeTrek/Resources/views/index.blade.php @@ -36,7 +36,6 @@ - diff --git a/Modules/Prospect/Resources/views/create.blade.php b/Modules/Prospect/Resources/views/create.blade.php index 8a00286697..17716d2e50 100644 --- a/Modules/Prospect/Resources/views/create.blade.php +++ b/Modules/Prospect/Resources/views/create.blade.php @@ -45,14 +45,13 @@
- - - + @endforeach
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 697afbd8b6..5892f7e10e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -24,26 +24,16 @@ public function __construct() * Show the application dashboard. */ public function index() -{ - // Book suggestion logic remains unchanged + { $unreadBook = session('disable_book_suggestion') ? null : Book::getRandomUnreadBook(); - // Replace OfficeLocation dependency with a static list or alternative logic - $centres = collect([ - ['id' => 1, 'centre_name' => 'Center 1'], - ['id' => 2, 'centre_name' => 'Center 2'], - ['id' => 3, 'centre_name' => 'Center 3'], - ])->sortBy('centre_name'); - - // Handle the selected location for the user $selectedLocation = auth()->user()->office_location ?? 'Default Location'; return view('home')->with([ 'book' => $unreadBook, - 'centres' => $centres, 'selectedLocation' => $selectedLocation, ]); -} + } /** @@ -81,9 +71,9 @@ public function getUserGroups($email) public function storeEmployeeLocation(Request $request) { - // $request->validate([ - // 'centre_name' => 'required|exists:office_locations,centre_name', - // ]); + $request->validate([ + 'centre_name' => 'required|string', + ]); UserMeta::updateOrCreate( ['user_id' => auth()->user()->id, 'meta_key' => 'office_location'], @@ -92,4 +82,4 @@ public function storeEmployeeLocation(Request $request) return redirect('home'); } -} +} \ No newline at end of file