first commit
This commit is contained in:
0
Modules/Admin/app/Repositories/.gitkeep
Normal file
0
Modules/Admin/app/Repositories/.gitkeep
Normal file
12
Modules/Admin/app/Repositories/AppreciationInterface.php
Normal file
12
Modules/Admin/app/Repositories/AppreciationInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface AppreciationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getAppreciationById($appreciationId);
|
||||
public function delete($appreciationId);
|
||||
public function create(array $appreciationDetails);
|
||||
public function update($appreciationId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/AppreciationRepository.php
Normal file
35
Modules/Admin/app/Repositories/AppreciationRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Appreciation;
|
||||
|
||||
|
||||
class AppreciationRepository implements AppreciationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Appreciation::get();
|
||||
}
|
||||
|
||||
public function getAppreciationById($appreciationId)
|
||||
{
|
||||
return Appreciation::findOrFail($appreciationId);
|
||||
}
|
||||
|
||||
public function delete($appreciationId)
|
||||
{
|
||||
Appreciation::destroy($appreciationId);
|
||||
}
|
||||
|
||||
public function create(array $appreciationDetails)
|
||||
{
|
||||
return Appreciation::create($appreciationDetails);
|
||||
}
|
||||
|
||||
public function update($appreciationId, array $newDetails)
|
||||
{
|
||||
return Appreciation::where('appreciation_id', $appreciationId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/CasteInterface.php
Normal file
12
Modules/Admin/app/Repositories/CasteInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface CasteInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getCasteById($casteId);
|
||||
public function delete($casteId);
|
||||
public function create(array $casteDetails);
|
||||
public function update($casteId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/CasteRepository.php
Normal file
35
Modules/Admin/app/Repositories/CasteRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Caste;
|
||||
|
||||
|
||||
class CasteRepository implements CasteInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Caste::get();
|
||||
}
|
||||
|
||||
public function getCasteById($casteId)
|
||||
{
|
||||
return Caste::findOrFail($casteId);
|
||||
}
|
||||
|
||||
public function delete($casteId)
|
||||
{
|
||||
Caste::destroy($casteId);
|
||||
}
|
||||
|
||||
public function create(array $casteDetails)
|
||||
{
|
||||
return Caste::create($casteDetails);
|
||||
}
|
||||
|
||||
public function update($casteId, array $newDetails)
|
||||
{
|
||||
return Caste::where('id', $casteId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/CityInterface.php
Normal file
12
Modules/Admin/app/Repositories/CityInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface CityInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getCityById($cityId);
|
||||
public function delete($cityId);
|
||||
public function create(array $cityDetails);
|
||||
public function update($cityId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/CityRepository.php
Normal file
35
Modules/Admin/app/Repositories/CityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\City;
|
||||
|
||||
|
||||
class CityRepository implements CityInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return City::get();
|
||||
}
|
||||
|
||||
public function getCityById($cityId)
|
||||
{
|
||||
return City::findOrFail($cityId);
|
||||
}
|
||||
|
||||
public function delete($cityId)
|
||||
{
|
||||
City::destroy($cityId);
|
||||
}
|
||||
|
||||
public function create(array $cityDetails)
|
||||
{
|
||||
return City::create($cityDetails);
|
||||
}
|
||||
|
||||
public function update($cityId, array $newDetails)
|
||||
{
|
||||
return City::where('id', $cityId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/CompanyInterface.php
Normal file
12
Modules/Admin/app/Repositories/CompanyInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface CompanyInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getCompanyById($companyId);
|
||||
public function delete($companyId);
|
||||
public function create(array $companyDetails);
|
||||
public function update($companyId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/CompanyRepository.php
Normal file
35
Modules/Admin/app/Repositories/CompanyRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Company;
|
||||
|
||||
|
||||
class CompanyRepository implements CompanyInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Company::get();
|
||||
}
|
||||
|
||||
public function getCompanyById($companyId)
|
||||
{
|
||||
return Company::findOrFail($companyId);
|
||||
}
|
||||
|
||||
public function delete($companyId)
|
||||
{
|
||||
Company::destroy($companyId);
|
||||
}
|
||||
|
||||
public function create(array $companyDetails)
|
||||
{
|
||||
return Company::create($companyDetails);
|
||||
}
|
||||
|
||||
public function update($companyId, array $newDetails)
|
||||
{
|
||||
return Company::where('id', $companyId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/CompanyTypeInterface.php
Normal file
12
Modules/Admin/app/Repositories/CompanyTypeInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface CompanyTypeInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getCompanyTypeById($companyTypeId);
|
||||
public function delete($companyTypeId);
|
||||
public function create(array $companyTypeDetails);
|
||||
public function update($companyTypeId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/CompanyTypeRepository.php
Normal file
35
Modules/Admin/app/Repositories/CompanyTypeRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\CompanyType;
|
||||
|
||||
|
||||
class CompanyTypeRepository implements CompanyTypeInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return CompanyType::get();
|
||||
}
|
||||
|
||||
public function getCompanyTypeById($companyTypeId)
|
||||
{
|
||||
return CompanyType::findOrFail($companyTypeId);
|
||||
}
|
||||
|
||||
public function delete($companyTypeId)
|
||||
{
|
||||
CompanyType::destroy($companyTypeId);
|
||||
}
|
||||
|
||||
public function create(array $companyTypeDetails)
|
||||
{
|
||||
return CompanyType::create($companyTypeDetails);
|
||||
}
|
||||
|
||||
public function update($companyTypeId, array $newDetails)
|
||||
{
|
||||
return CompanyType::where('id', $companyTypeId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/ComplaintInterface.php
Normal file
12
Modules/Admin/app/Repositories/ComplaintInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface ComplaintInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getComplaintById($complaintId);
|
||||
public function delete($complaintId);
|
||||
public function create(array $complaintDetails);
|
||||
public function update($complaintId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/ComplaintRepository.php
Normal file
35
Modules/Admin/app/Repositories/ComplaintRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Complaint;
|
||||
|
||||
|
||||
class ComplaintRepository implements ComplaintInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Complaint::get();
|
||||
}
|
||||
|
||||
public function getComplaintById($complaintId)
|
||||
{
|
||||
return Complaint::findOrFail($complaintId);
|
||||
}
|
||||
|
||||
public function delete($complaintId)
|
||||
{
|
||||
Complaint::destroy($complaintId);
|
||||
}
|
||||
|
||||
public function create(array $complaintDetails)
|
||||
{
|
||||
return Complaint::create($complaintDetails);
|
||||
}
|
||||
|
||||
public function update($complaintId, array $newDetails)
|
||||
{
|
||||
return Complaint::where('complaint_id', $complaintId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
13
Modules/Admin/app/Repositories/CountryInterface.php
Normal file
13
Modules/Admin/app/Repositories/CountryInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface CountryInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getCountryById($countryId);
|
||||
public function delete($countryId);
|
||||
public function create(array $countryDetails);
|
||||
public function update($countryId, array $newDetails);
|
||||
public function pluck();
|
||||
}
|
39
Modules/Admin/app/Repositories/CountryRepository.php
Normal file
39
Modules/Admin/app/Repositories/CountryRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Country;
|
||||
|
||||
|
||||
class CountryRepository implements CountryInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Country::get();
|
||||
}
|
||||
|
||||
public function getCountryById($countryId)
|
||||
{
|
||||
return Country::findOrFail($countryId);
|
||||
}
|
||||
|
||||
public function delete($countryId)
|
||||
{
|
||||
Country::destroy($countryId);
|
||||
}
|
||||
|
||||
public function create(array $countryDetails)
|
||||
{
|
||||
return Country::create($countryDetails);
|
||||
}
|
||||
|
||||
public function update($countryId, array $newDetails)
|
||||
{
|
||||
return Country::where('id', $countryId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck(){
|
||||
return Country::pluck('name','id');
|
||||
}
|
||||
|
||||
}
|
13
Modules/Admin/app/Repositories/DepartmentInterface.php
Normal file
13
Modules/Admin/app/Repositories/DepartmentInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface DepartmentInterface
|
||||
{
|
||||
public function pluck();
|
||||
public function findAll();
|
||||
public function getDepartmentById($departmentId);
|
||||
public function delete($departmentId);
|
||||
public function create(array $departmentDetails);
|
||||
public function update($departmentId, array $newDetails);
|
||||
}
|
39
Modules/Admin/app/Repositories/DepartmentRepository.php
Normal file
39
Modules/Admin/app/Repositories/DepartmentRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Department;
|
||||
|
||||
|
||||
class DepartmentRepository implements DepartmentInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Department::get();
|
||||
}
|
||||
|
||||
public function getDepartmentById($departmentId)
|
||||
{
|
||||
return Department::findOrFail($departmentId);
|
||||
}
|
||||
|
||||
public function delete($departmentId)
|
||||
{
|
||||
Department::destroy($departmentId);
|
||||
}
|
||||
|
||||
public function create(array $departmentDetails)
|
||||
{
|
||||
return Department::create($departmentDetails);
|
||||
}
|
||||
|
||||
public function update($departmentId, array $newDetails)
|
||||
{
|
||||
return Department::where('department_id', $departmentId)->update($newDetails);
|
||||
}
|
||||
|
||||
|
||||
public function pluck(){
|
||||
return Department::pluck('name','department_id');
|
||||
}
|
||||
}
|
14
Modules/Admin/app/Repositories/DesignationInterface.php
Normal file
14
Modules/Admin/app/Repositories/DesignationInterface.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface DesignationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getDesignationById($designationId);
|
||||
public function delete($designationId);
|
||||
public function create(array $designationDetails);
|
||||
public function update($designationId, array $newDetails);
|
||||
|
||||
public function pluck();
|
||||
}
|
39
Modules/Admin/app/Repositories/DesignationRepository.php
Normal file
39
Modules/Admin/app/Repositories/DesignationRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Designation;
|
||||
|
||||
|
||||
class DesignationRepository implements DesignationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Designation::get();
|
||||
}
|
||||
|
||||
public function getDesignationById($designationId)
|
||||
{
|
||||
return Designation::findOrFail($designationId);
|
||||
}
|
||||
|
||||
public function delete($designationId)
|
||||
{
|
||||
Designation::destroy($designationId);
|
||||
}
|
||||
|
||||
public function create(array $designationDetails)
|
||||
{
|
||||
return Designation::create($designationDetails);
|
||||
}
|
||||
|
||||
public function update($designationId, array $newDetails)
|
||||
{
|
||||
return Designation::where('designation_id', $designationId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck(){
|
||||
return Designation::pluck('name','designation_id');
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/DistrictInterface.php
Normal file
12
Modules/Admin/app/Repositories/DistrictInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface DistrictInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getDistrictById($districtId);
|
||||
public function delete($districtId);
|
||||
public function create(array $districtDetails);
|
||||
public function update($districtId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/DistrictRepository.php
Normal file
35
Modules/Admin/app/Repositories/DistrictRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\District;
|
||||
|
||||
|
||||
class DistrictRepository implements DistrictInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return District::get();
|
||||
}
|
||||
|
||||
public function getDistrictById($districtId)
|
||||
{
|
||||
return District::findOrFail($districtId);
|
||||
}
|
||||
|
||||
public function delete($districtId)
|
||||
{
|
||||
District::destroy($districtId);
|
||||
}
|
||||
|
||||
public function create(array $districtDetails)
|
||||
{
|
||||
return District::create($districtDetails);
|
||||
}
|
||||
|
||||
public function update($districtId, array $newDetails)
|
||||
{
|
||||
return District::where('id', $districtId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/DropdownInterface.php
Normal file
12
Modules/Admin/app/Repositories/DropdownInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface DropdownInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getDropdownById($DropdownId);
|
||||
public function delete($DropdownId);
|
||||
public function create(array $DropdownDetails);
|
||||
public function update($DropdownId, array $newDetails);
|
||||
}
|
34
Modules/Admin/app/Repositories/DropdownRepository.php
Normal file
34
Modules/Admin/app/Repositories/DropdownRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Dropdown;
|
||||
|
||||
class DropdownRepository implements DropdownInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Dropdown::get();
|
||||
}
|
||||
|
||||
public function getDropdownById($DropdownId)
|
||||
{
|
||||
return Dropdown::findOrFail($DropdownId);
|
||||
}
|
||||
|
||||
public function delete($DropdownId)
|
||||
{
|
||||
Dropdown::destroy($DropdownId);
|
||||
}
|
||||
|
||||
public function create(array $DropdownDetails)
|
||||
{
|
||||
return Dropdown::create($DropdownDetails);
|
||||
}
|
||||
|
||||
public function update($DropdownId, array $newDetails)
|
||||
{
|
||||
return Dropdown::where('id', $DropdownId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/EthnicityInterface.php
Normal file
12
Modules/Admin/app/Repositories/EthnicityInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface EthnicityInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getEthnicityById($ethnicityId);
|
||||
public function delete($ethnicityId);
|
||||
public function create(array $ethnicityDetails);
|
||||
public function update($ethnicityId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/EthnicityRepository.php
Normal file
35
Modules/Admin/app/Repositories/EthnicityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Ethnicity;
|
||||
|
||||
|
||||
class EthnicityRepository implements EthnicityInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Ethnicity::get();
|
||||
}
|
||||
|
||||
public function getEthnicityById($ethnicityId)
|
||||
{
|
||||
return Ethnicity::findOrFail($ethnicityId);
|
||||
}
|
||||
|
||||
public function delete($ethnicityId)
|
||||
{
|
||||
Ethnicity::destroy($ethnicityId);
|
||||
}
|
||||
|
||||
public function create(array $ethnicityDetails)
|
||||
{
|
||||
return Ethnicity::create($ethnicityDetails);
|
||||
}
|
||||
|
||||
public function update($ethnicityId, array $newDetails)
|
||||
{
|
||||
return Ethnicity::where('id', $ethnicityId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/EventInterface.php
Normal file
12
Modules/Admin/app/Repositories/EventInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface EventInterface
|
||||
{
|
||||
public function findAll($filters = [], $limit = null, $offset = null);
|
||||
public function getEventById($eventId);
|
||||
public function delete($eventId);
|
||||
public function create(array $eventDetails);
|
||||
public function update($eventId, array $newDetails);
|
||||
}
|
43
Modules/Admin/app/Repositories/EventRepository.php
Normal file
43
Modules/Admin/app/Repositories/EventRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Event;
|
||||
|
||||
class EventRepository implements EventInterface
|
||||
{
|
||||
public function findAll($filters = [], $limit = null, $offset = null)
|
||||
{
|
||||
return Event::when($filters, function ($query) use ($filters) {
|
||||
if (isset($filters["start_date"])) {
|
||||
$query->whereDate("start_date", ">=", $filters["start_date"]);
|
||||
}
|
||||
|
||||
if (isset($filters["end_date"])) {
|
||||
$query->whereDate("end_date", "<=", $filters["end_date"]);
|
||||
}
|
||||
|
||||
})->latest()->get();
|
||||
}
|
||||
|
||||
public function getEventById($eventId)
|
||||
{
|
||||
return Event::findOrFail($eventId);
|
||||
}
|
||||
|
||||
public function delete($eventId)
|
||||
{
|
||||
Event::destroy($eventId);
|
||||
}
|
||||
|
||||
public function create(array $eventDetails)
|
||||
{
|
||||
return Event::create($eventDetails);
|
||||
}
|
||||
|
||||
public function update($eventId, array $newDetails)
|
||||
{
|
||||
return Event::where('event_id', $eventId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
14
Modules/Admin/app/Repositories/FieldInterface.php
Normal file
14
Modules/Admin/app/Repositories/FieldInterface.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface FieldInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getFieldById($FieldId);
|
||||
public function getList();
|
||||
public function getDropdownByAlias($alias);
|
||||
public function delete($FieldId);
|
||||
public function create(array $FieldDetails);
|
||||
public function update($FieldId, array $newDetails);
|
||||
}
|
48
Modules/Admin/app/Repositories/FieldRepository.php
Normal file
48
Modules/Admin/app/Repositories/FieldRepository.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Field;
|
||||
|
||||
class FieldRepository implements FieldInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Field::get();
|
||||
}
|
||||
|
||||
public function getFieldById($FieldId)
|
||||
{
|
||||
return Field::findOrFail($FieldId);
|
||||
}
|
||||
|
||||
public function getList()
|
||||
{
|
||||
return Field::pluck('title', 'id');
|
||||
}
|
||||
|
||||
public function getDropdownByAlias($alias)
|
||||
{
|
||||
$fieldModel = Field::where("alias", $alias)->first();
|
||||
if ($fieldModel) {
|
||||
return $fieldModel->dropdown()->pluck('title', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function delete($FieldId)
|
||||
{
|
||||
Field::destroy($FieldId);
|
||||
}
|
||||
|
||||
public function create(array $FieldDetails)
|
||||
{
|
||||
return Field::create($FieldDetails);
|
||||
}
|
||||
|
||||
public function update($FieldId, array $newDetails)
|
||||
{
|
||||
return Field::where('id', $FieldId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/GenderInterface.php
Normal file
12
Modules/Admin/app/Repositories/GenderInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface GenderInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getGenderById($genderId);
|
||||
public function delete($genderId);
|
||||
public function create(array $genderDetails);
|
||||
public function update($genderId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/GenderRepository.php
Normal file
35
Modules/Admin/app/Repositories/GenderRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Gender;
|
||||
|
||||
|
||||
class GenderRepository implements GenderInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Gender::get();
|
||||
}
|
||||
|
||||
public function getGenderById($genderId)
|
||||
{
|
||||
return Gender::findOrFail($genderId);
|
||||
}
|
||||
|
||||
public function delete($genderId)
|
||||
{
|
||||
Gender::destroy($genderId);
|
||||
}
|
||||
|
||||
public function create(array $genderDetails)
|
||||
{
|
||||
return Gender::create($genderDetails);
|
||||
}
|
||||
|
||||
public function update($genderId, array $newDetails)
|
||||
{
|
||||
return Gender::where('id', $genderId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/HolidayInterface.php
Normal file
12
Modules/Admin/app/Repositories/HolidayInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface HolidayInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getHolidayById($holidayId);
|
||||
public function delete($holidayId);
|
||||
public function create(array $holidayDetails);
|
||||
public function update($holidayId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/HolidayRepository.php
Normal file
35
Modules/Admin/app/Repositories/HolidayRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Holiday;
|
||||
|
||||
|
||||
class HolidayRepository implements HolidayInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Holiday::get();
|
||||
}
|
||||
|
||||
public function getHolidayById($holidayId)
|
||||
{
|
||||
return Holiday::findOrFail($holidayId);
|
||||
}
|
||||
|
||||
public function delete($holidayId)
|
||||
{
|
||||
Holiday::destroy($holidayId);
|
||||
}
|
||||
|
||||
public function create(array $holidayDetails)
|
||||
{
|
||||
return Holiday::create($holidayDetails);
|
||||
}
|
||||
|
||||
public function update($holidayId, array $newDetails)
|
||||
{
|
||||
return Holiday::where('holiday_id', $holidayId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/MunicipalityInterface.php
Normal file
12
Modules/Admin/app/Repositories/MunicipalityInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface MunicipalityInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getMunicipalityById($municipalityId);
|
||||
public function delete($municipalityId);
|
||||
public function create(array $municipalityDetails);
|
||||
public function update($municipalityId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/MunicipalityRepository.php
Normal file
35
Modules/Admin/app/Repositories/MunicipalityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Municipality;
|
||||
|
||||
|
||||
class MunicipalityRepository implements MunicipalityInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Municipality::get();
|
||||
}
|
||||
|
||||
public function getMunicipalityById($municipalityId)
|
||||
{
|
||||
return Municipality::findOrFail($municipalityId);
|
||||
}
|
||||
|
||||
public function delete($municipalityId)
|
||||
{
|
||||
Municipality::destroy($municipalityId);
|
||||
}
|
||||
|
||||
public function create(array $municipalityDetails)
|
||||
{
|
||||
return Municipality::create($municipalityDetails);
|
||||
}
|
||||
|
||||
public function update($municipalityId, array $newDetails)
|
||||
{
|
||||
return Municipality::where('id', $municipalityId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/NationalityInterface.php
Normal file
12
Modules/Admin/app/Repositories/NationalityInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface NationalityInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getNationalityById($nationalityId);
|
||||
public function delete($nationalityId);
|
||||
public function create(array $nationalityDetails);
|
||||
public function update($nationalityId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/NationalityRepository.php
Normal file
35
Modules/Admin/app/Repositories/NationalityRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Nationality;
|
||||
|
||||
|
||||
class NationalityRepository implements NationalityInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Nationality::get();
|
||||
}
|
||||
|
||||
public function getNationalityById($nationalityId)
|
||||
{
|
||||
return Nationality::findOrFail($nationalityId);
|
||||
}
|
||||
|
||||
public function delete($nationalityId)
|
||||
{
|
||||
Nationality::destroy($nationalityId);
|
||||
}
|
||||
|
||||
public function create(array $nationalityDetails)
|
||||
{
|
||||
return Nationality::create($nationalityDetails);
|
||||
}
|
||||
|
||||
public function update($nationalityId, array $newDetails)
|
||||
{
|
||||
return Nationality::where('id', $nationalityId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/ProgressStatusInterface.php
Normal file
12
Modules/Admin/app/Repositories/ProgressStatusInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface ProgressStatusInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getProgressStatusById($progressStatusId);
|
||||
public function delete($progressStatusId);
|
||||
public function create(array $progressStatusDetails);
|
||||
public function update($progressStatusId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/ProgressStatusRepository.php
Normal file
35
Modules/Admin/app/Repositories/ProgressStatusRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\ProgressStatus;
|
||||
|
||||
|
||||
class ProgressStatusRepository implements ProgressStatusInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return ProgressStatus::get();
|
||||
}
|
||||
|
||||
public function getProgressStatusById($progressStatusId)
|
||||
{
|
||||
return ProgressStatus::findOrFail($progressStatusId);
|
||||
}
|
||||
|
||||
public function delete($progressStatusId)
|
||||
{
|
||||
ProgressStatus::destroy($progressStatusId);
|
||||
}
|
||||
|
||||
public function create(array $progressStatusDetails)
|
||||
{
|
||||
return ProgressStatus::create($progressStatusDetails);
|
||||
}
|
||||
|
||||
public function update($progressStatusId, array $newDetails)
|
||||
{
|
||||
return ProgressStatus::where('id', $progressStatusId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface PromotionDemotionInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getPromotionDemotionById($promotionDemotionId);
|
||||
public function delete($promotionDemotionId);
|
||||
public function create(array $promotionDemotionDetails);
|
||||
public function update($promotionDemotionId, array $newDetails);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\PromotionDemotion;
|
||||
|
||||
|
||||
class PromotionDemotionRepository implements PromotionDemotionInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return PromotionDemotion::get();
|
||||
}
|
||||
|
||||
public function getPromotionDemotionById($promotionDemotionId)
|
||||
{
|
||||
return PromotionDemotion::findOrFail($promotionDemotionId);
|
||||
}
|
||||
|
||||
public function delete($promotionDemotionId)
|
||||
{
|
||||
PromotionDemotion::destroy($promotionDemotionId);
|
||||
}
|
||||
|
||||
public function create(array $promotionDemotionDetails)
|
||||
{
|
||||
return PromotionDemotion::create($promotionDemotionDetails);
|
||||
}
|
||||
|
||||
public function update($promotionDemotionId, array $newDetails)
|
||||
{
|
||||
return PromotionDemotion::whereId($promotionDemotionId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/ProvinceInterface.php
Normal file
12
Modules/Admin/app/Repositories/ProvinceInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface ProvinceInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getProvinceById($provinceId);
|
||||
public function delete($provinceId);
|
||||
public function create(array $provinceDetails);
|
||||
public function update($provinceId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/ProvinceRepository.php
Normal file
35
Modules/Admin/app/Repositories/ProvinceRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Province;
|
||||
|
||||
|
||||
class ProvinceRepository implements ProvinceInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Province::get();
|
||||
}
|
||||
|
||||
public function getProvinceById($provinceId)
|
||||
{
|
||||
return Province::findOrFail($provinceId);
|
||||
}
|
||||
|
||||
public function delete($provinceId)
|
||||
{
|
||||
Province::destroy($provinceId);
|
||||
}
|
||||
|
||||
public function create(array $provinceDetails)
|
||||
{
|
||||
return Province::create($provinceDetails);
|
||||
}
|
||||
|
||||
public function update($provinceId, array $newDetails)
|
||||
{
|
||||
return Province::where('id', $provinceId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/ResignationInterface.php
Normal file
12
Modules/Admin/app/Repositories/ResignationInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface ResignationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getResignationById($resignationId);
|
||||
public function delete($resignationId);
|
||||
public function create(array $resignationDetails);
|
||||
public function update($resignationId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/ResignationRepository.php
Normal file
35
Modules/Admin/app/Repositories/ResignationRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Resignation;
|
||||
|
||||
|
||||
class ResignationRepository implements ResignationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Resignation::get();
|
||||
}
|
||||
|
||||
public function getResignationById($resignationId)
|
||||
{
|
||||
return Resignation::findOrFail($resignationId);
|
||||
}
|
||||
|
||||
public function delete($resignationId)
|
||||
{
|
||||
Resignation::destroy($resignationId);
|
||||
}
|
||||
|
||||
public function create(array $resignationDetails)
|
||||
{
|
||||
return Resignation::create($resignationDetails);
|
||||
}
|
||||
|
||||
public function update($resignationId, array $newDetails)
|
||||
{
|
||||
return Resignation::where('resignation_id', $resignationId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/TransferInterface.php
Normal file
12
Modules/Admin/app/Repositories/TransferInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface TransferInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getTransferById($transferId);
|
||||
public function delete($transferId);
|
||||
public function create(array $transferDetails);
|
||||
public function update($transferId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/TransferRepository.php
Normal file
35
Modules/Admin/app/Repositories/TransferRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Transfer;
|
||||
|
||||
|
||||
class TransferRepository implements TransferInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Transfer::get();
|
||||
}
|
||||
|
||||
public function getTransferById($transferId)
|
||||
{
|
||||
return Transfer::findOrFail($transferId);
|
||||
}
|
||||
|
||||
public function delete($transferId)
|
||||
{
|
||||
Transfer::destroy($transferId);
|
||||
}
|
||||
|
||||
public function create(array $transferDetails)
|
||||
{
|
||||
return Transfer::create($transferDetails);
|
||||
}
|
||||
|
||||
public function update($transferId, array $newDetails)
|
||||
{
|
||||
return Transfer::where('transfer_id', $transferId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/WarningInterface.php
Normal file
12
Modules/Admin/app/Repositories/WarningInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface WarningInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getWarningById($warningId);
|
||||
public function delete($warningId);
|
||||
public function create(array $warningDetails);
|
||||
public function update($warningId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/WarningRepository.php
Normal file
35
Modules/Admin/app/Repositories/WarningRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Warning;
|
||||
|
||||
|
||||
class WarningRepository implements WarningInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Warning::get();
|
||||
}
|
||||
|
||||
public function getWarningById($warningId)
|
||||
{
|
||||
return Warning::findOrFail($warningId);
|
||||
}
|
||||
|
||||
public function delete($warningId)
|
||||
{
|
||||
Warning::destroy($warningId);
|
||||
}
|
||||
|
||||
public function create(array $warningDetails)
|
||||
{
|
||||
return Warning::create($warningDetails);
|
||||
}
|
||||
|
||||
public function update($warningId, array $newDetails)
|
||||
{
|
||||
return Warning::where('warning_id', $warningId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
13
Modules/Admin/app/Repositories/WorkShiftInterface.php
Normal file
13
Modules/Admin/app/Repositories/WorkShiftInterface.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface WorkShiftInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getWorkShiftById($workShiftId);
|
||||
public function delete($workShiftId);
|
||||
public function create(array $workShiftDetails);
|
||||
public function update($workShiftId, array $newDetails);
|
||||
public function pluck();
|
||||
}
|
39
Modules/Admin/app/Repositories/WorkShiftRepository.php
Normal file
39
Modules/Admin/app/Repositories/WorkShiftRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\WorkShift;
|
||||
|
||||
|
||||
class WorkShiftRepository implements WorkShiftInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return WorkShift::get();
|
||||
}
|
||||
|
||||
public function getWorkShiftById($workShiftId)
|
||||
{
|
||||
return WorkShift::findOrFail($workShiftId);
|
||||
}
|
||||
|
||||
public function delete($workShiftId)
|
||||
{
|
||||
WorkShift::destroy($workShiftId);
|
||||
}
|
||||
|
||||
public function create(array $workShiftDetails)
|
||||
{
|
||||
return WorkShift::create($workShiftDetails);
|
||||
}
|
||||
|
||||
public function update($workShiftId, array $newDetails)
|
||||
{
|
||||
return WorkShift::where('work_shift_id', $workShiftId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck(){
|
||||
return WorkShift::pluck('name','work_shift_id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user