diff --git a/Modules/HR/Http/Controllers/Recruitment/ApplicationController.php b/Modules/HR/Http/Controllers/Recruitment/ApplicationController.php index c717f98ef0..0cd37997b5 100644 --- a/Modules/HR/Http/Controllers/Recruitment/ApplicationController.php +++ b/Modules/HR/Http/Controllers/Recruitment/ApplicationController.php @@ -145,7 +145,7 @@ public function saveOfferLetter(Application $application) $pdf = Pdf::loadView('hr.application.draft-joining-letter', compact('applicant', 'job', 'offer_letter_body')); $fileName = FileHelper::getOfferLetterFileName($applicant, $pdf); $directory = 'app/public/' . config('constants.hr.offer-letters-dir'); - if (!is_dir(storage_path($directory)) && !file_exists(storage_path($directory))) { + if (! is_dir(storage_path($directory)) && ! file_exists(storage_path($directory))) { mkdir(storage_path($directory), 0, true); } $fullPath = storage_path($directory . '/' . $fileName); @@ -219,7 +219,7 @@ public function sendApplicationMail(CustomApplicationMailRequest $mailRequest, A public function viewOfferLetter(Application $application) { - if (!Storage::exists($application->offer_letter)) { + if (! Storage::exists($application->offer_letter)) { return false; } diff --git a/Modules/HR/Services/ApplicationService.php b/Modules/HR/Services/ApplicationService.php index f0db5a0894..30bab965cc 100644 --- a/Modules/HR/Services/ApplicationService.php +++ b/Modules/HR/Services/ApplicationService.php @@ -6,21 +6,20 @@ use Carbon\Carbon; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Http; +use Illuminate\Support\Str; use Modules\HR\Contracts\ApplicationServiceContract; use Modules\HR\Entities\Applicant; +use Modules\HR\Entities\ApplicantMeta; use Modules\HR\Entities\Application; use Modules\HR\Entities\Job; +use Modules\HR\Entities\Round; +use Modules\HR\Entities\University; use Modules\HR\Events\CustomMailTriggeredForApplication; use Modules\User\Entities\User; -use Illuminate\Support\Str; -use Modules\HR\Entities\University; -use Modules\HR\Entities\Round; -use Modules\HR\Entities\ApplicantMeta; class ApplicationService implements ApplicationServiceContract { - public function index($applicationType) { @@ -53,19 +52,19 @@ public function index($applicationType) $loggedInUserId = auth()->id(); $applications = Application::select('hr_applications.*') - ->join('hr_application_round', function ($join) { - $join->on('hr_application_round.hr_application_id', '=', 'hr_applications.id') - ->where('hr_application_round.is_latest', true); - }) - ->with(['applicant', 'job', 'tags', 'latestApplicationRound']) - ->whereHas('latestApplicationRound') - ->applyFilter($filters) - ->orderByRaw("FIELD(hr_application_round.scheduled_person_id, {$loggedInUserId} ) DESC") - ->orderByRaw('ISNULL(hr_application_round.scheduled_date) ASC') - ->orderByRaw('hr_application_round.scheduled_date ASC') - ->latest() - ->paginate(config('constants.pagination_size')) - ->appends(request()->except('page')); + ->join('hr_application_round', function ($join) { + $join->on('hr_application_round.hr_application_id', '=', 'hr_applications.id') + ->where('hr_application_round.is_latest', true); + }) + ->with(['applicant', 'job', 'tags', 'latestApplicationRound']) + ->whereHas('latestApplicationRound') + ->applyFilter($filters) + ->orderByRaw("FIELD(hr_application_round.scheduled_person_id, {$loggedInUserId} ) DESC") + ->orderByRaw('ISNULL(hr_application_round.scheduled_date) ASC') + ->orderByRaw('hr_application_round.scheduled_date ASC') + ->latest() + ->paginate(config('constants.pagination_size')) + ->appends(request()->except('page')); $countFilters = array_except($filters, ['status', 'round']); $attr = [ 'applications' => $applications, @@ -177,15 +176,15 @@ public function addSubscriberToCampaigns($parameters, $subscriptionLists) Http::withHeaders([ 'Accept' => 'application/json', - 'Content-Type'=>'application/json', + 'Content-Type' => 'application/json', ]) - ->withToken($token) - ->post($url, [ - 'name' => $name, - 'email' => $parameters['email'], - 'phone' => $parameters['phone'], - 'subscription_lists' => $subscriptionLists, - ]); + ->withToken($token) + ->post($url, [ + 'name' => $name, + 'email' => $parameters['email'], + 'phone' => $parameters['phone'], + 'subscription_lists' => $subscriptionLists, + ]); } public function getToken()