first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

@ -0,0 +1,127 @@
<?php
namespace Modules\Recruit\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeRepository;
use Modules\Recruit\Repositories\InterviewScheduleInterface;
use Modules\Recruit\Repositories\InterviewScheduleRepository;
use Modules\Recruit\Repositories\JobPostInterface;
use Modules\Recruit\Repositories\JobPostRepository;
use Yoeunes\Toastr\Facades\Toastr;
class InterviewScheduleController extends Controller
{
private $interviewScheduleRepository;
private $jobPostRepository;
private $employeeRepository;
public function __construct(InterviewScheduleInterface $interviewScheduleRepository, JobPostInterface $jobPostRepository, EmployeeRepository $employeeRepository)
{
$this->interviewScheduleRepository = $interviewScheduleRepository;
$this->jobPostRepository = $jobPostRepository;
$this->employeeRepository = $employeeRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Interview Schedule Lists';
$data['interviewScheduleLists'] = $this->interviewScheduleRepository->findAll();
return view('recruit::interviewschedules.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create InterviewSchedule';
$data['editable'] = false;
$data['jobPostLists'] = $this->jobPostRepository->pluck();
$data['employeeLists'] = $this->employeeRepository->pluck();
return view('recruit::interviewschedules.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$request->merge([
'createdBy' => auth()->user()->id,
]);
try {
$this->interviewScheduleRepository->create($request->all());
toastr()->success('InterviewSchedule Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
// return redirect()->route('interviewSchedule.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('recruit::interviewschedules.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit InterviewSchedule';
$data['editable'] = true;
$data['jobPostLists'] = $this->jobPostRepository->pluck();
$data['employeeLists'] = $this->employeeRepository->pluck();
$data['interviewSchedule'] = $this->interviewScheduleRepository->getInterviewScheduleById($id);
return view('recruit::interviewschedules.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$inputData = $request->all();
try {
$this->interviewScheduleRepository->update($id, $inputData);
toastr()->success('InterviewSchecule Updated Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('interviewSchedule.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->interviewScheduleRepository->delete($id);
toastr()->success('InterviewSchecule Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,136 @@
<?php
namespace Modules\Recruit\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Admin\Repositories\FieldRepository;
use Modules\Recruit\Repositories\JobApplicationInterface;
use Modules\Recruit\Repositories\JobApplicationRepository;
use Modules\Recruit\Repositories\JobPostInterface;
use Modules\Recruit\Repositories\JobPostRepository;
use Yoeunes\Toastr\Facades\Toastr;
class JobApplicationController extends Controller
{
private $jobApplicationRepository;
private $jobPostRepository;
private $fieldRepository;
public function __construct(JobApplicationInterface $jobApplicationRepository, JobPostInterface $jobPostRepository, FieldRepository $fieldRepository)
{
$this->jobApplicationRepository = $jobApplicationRepository;
$this->jobPostRepository = $jobPostRepository;
$this->fieldRepository = $fieldRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'JobApplication Lists';
$data['jobApplicationLists'] = $this->jobApplicationRepository->findAll();
return view('recruit::jobapplications.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create JobApplication';
$data['editable'] = false;
$data['jobPostLists'] = $this->jobPostRepository->pluck();
$data['genderLists'] = $this->fieldRepository->getDropdownByAlias('gender');
return view('recruit::jobapplications.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$request->mergeIfMissing([
'createdBy' => auth()->user()->employee?->id,
'status' => 11,
]);
try {
$this->jobApplicationRepository->create($request->all());
toastr()->success('JobApplication Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('jobApplication.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('recruit::jobapplications.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit JobApplication';
$data['editable'] = true;
$data['jobPostLists'] = $this->jobPostRepository->pluck();
$data['genderLists'] = $this->fieldRepository->getDropdownByAlias('gender');
$data['jobApplication'] = $this->jobApplicationRepository->getJobApplicationById($id);
return view('recruit::jobapplications.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$request->mergeIfMissing([
'updatedBy' => auth()->user()->employee?->id,
'status' => 11,
]);
$inputData = $request->all();
try {
$this->jobApplicationRepository->update($id, $inputData);
toastr()->success('JobApplication Updated Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('jobApplication.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->jobApplicationRepository->delete($id);
toastr()->success('JobApplication Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,131 @@
<?php
namespace Modules\Recruit\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Admin\Repositories\DepartmentInterface;
use Modules\Admin\Repositories\DesignationInterface;
use Modules\Recruit\Repositories\JobPostInterface;
use Modules\Recruit\Repositories\JobPostRepository;
use Yoeunes\Toastr\Facades\Toastr;
class JobPostController extends Controller
{
private $jobPostRepository;
private $departmentRepository;
private $designationRepository;
public function __construct(JobPostInterface $jobPostRepository, DepartmentInterface $departmentRepository, DesignationInterface $designationRepository)
{
$this->jobPostRepository = $jobPostRepository;
$this->departmentRepository = $departmentRepository;
$this->designationRepository = $designationRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Job Post Lists';
$data['jobPostLists'] = $this->jobPostRepository->findAll();
return view('recruit::jobposts.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Job Post';
$data['editable'] = false;
$data['departmentLists'] = $this->departmentRepository->pluck();
$data['designationLists'] = $this->designationRepository->pluck();
return view('recruit::jobposts.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$request->mergeIfMissing([
'createdBy' => auth()->user()->employee?->id,
]);
try {
$this->jobPostRepository->create($request->all());
toastr()->success('JobPost Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('jobPost.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('recruit::jobposts.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit Job Post';
$data['editable'] = true;
$data['departmentLists'] = $this->departmentRepository->pluck();
$data['designationLists'] = $this->designationRepository->pluck();
$data['jobPost'] = $this->jobPostRepository->getJobPostById($id);
return view('recruit::jobposts.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$request->mergeIfMissing([
'updateBy' => auth()->user()->employee?->id,
]);
$inputData = $request->all();
try {
$this->jobPostRepository->update($id, $inputData);
toastr()->success('Job Post Updated Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('jobPost.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->jobPostRepository->delete($id);
toastr()->success('Job Post Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,151 @@
<?php
namespace Modules\Recruit\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Admin\Repositories\DepartmentInterface;
use Modules\Admin\Repositories\DepartmentRepository;
use Modules\Admin\Repositories\DesignationRepository;
use Modules\Admin\Repositories\WorkShiftInterface;
use Modules\Admin\Repositories\WorkShiftRepository;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\Employee\Repositories\EmployeeRepository;
use Modules\Recruit\Repositories\JobApplicationInterface;
use Modules\Recruit\Repositories\JobPostInterface;
use Modules\Recruit\Repositories\OfferLetterInterface;
use Modules\Recruit\Repositories\OfferLetterRepository;
use Modules\Recruit\Repositories\JobPostRepository;
use Yoeunes\Toastr\Facades\Toastr;
class OfferLetterController extends Controller
{
private $offerLetterRepository;
private $departmentRepository;
private $designationRepository;
private $workShiftRepository;
private $employeeRepository;
private $jobPostRepository;
private $jobApplicationRepository;
public function __construct(OfferLetterInterface $offerLetterRepository, DepartmentInterface $departmentRepository, DesignationRepository $designationRepository, WorkShiftRepository $workShiftRepository, EmployeeInterface $employeeRepository, JobApplicationInterface $jobApplicationRepository, JobPostRepository $jobPostRepository)
{
$this->offerLetterRepository = $offerLetterRepository;
$this->departmentRepository = $departmentRepository;
$this->designationRepository = $designationRepository;
$this->workShiftRepository = $workShiftRepository;
$this->employeeRepository = $employeeRepository;
$this->jobPostRepository = $jobPostRepository;
$this->jobApplicationRepository = $jobApplicationRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'OfferLetter Lists';
$data['offerLetterLists'] = $this->offerLetterRepository->findAll();
return view('recruit::offerletters.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create OfferLetter';
$data['editable'] = false;
$data['workShiftLists'] = $this->workShiftRepository->pluck();
$data['designationLists'] = $this->designationRepository->pluck();
$data['departmentLists'] = $this->departmentRepository->pluck();
$data['employeeLists'] = $this->employeeRepository->pluck();
$data['jobPostLists'] = $this->jobPostRepository->pluck();
$data['jobApplicationLists'] = $this->jobApplicationRepository->pluck();
$data['employeeLists'] = $this->employeeRepository->pluck();
return view('recruit::offerletters.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$request->merge([
'createdBy' => auth()->user()->id,
]);
try {
$this->offerLetterRepository->create($request->all());
toastr()->success('OfferLetter Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('offerLetter.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('recruit::offerletters.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit OfferLetter';
$data['editable'] = true;
$data['workShiftLists'] = $this->workShiftRepository->pluck();
$data['designationLists'] = $this->designationRepository->pluck();
$data['departmentLists'] = $this->departmentRepository->pluck();
$data['employeeLists'] = $this->employeeRepository->pluck();
$data['offerLetter'] = $this->offerLetterRepository->getOfferLetterById($id);
return view('recruit::offerletters.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$inputData = $request->all();
try {
$this->offerLetterRepository->update($id, $inputData);
toastr()->success('InterviewSchecule Updated Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('offerLetter.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->offerLetterRepository->delete($id);
toastr()->success('OfferLetter Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\Recruit\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class RecruitController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('recruit::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('recruit::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('recruit::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('recruit::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}