added company company type into admin module
This commit is contained in:
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('company_id', $companyId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user