36 lines
663 B
PHP
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);
|
||
|
}
|
||
|
|
||
|
}
|