Heera/Modules/Admin/app/Repositories/CompanyRepository.php

36 lines
663 B
PHP
Raw Normal View History

2024-05-16 03:46:08 +00:00
<?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);
}
}