Heera/Modules/Admin/app/Repositories/CompanyRepository.php
2024-05-16 09:31:08 +05:45

36 lines
663 B
PHP

<?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);
}
}