first commit
This commit is contained in:
38
Modules/Office/app/Repositories/GeneratorRepository.php
Normal file
38
Modules/Office/app/Repositories/GeneratorRepository.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Office\Repositories;
|
||||
|
||||
use Modules\Office\Models\Generator;
|
||||
|
||||
|
||||
class GeneratorRepository implements GeneratorInterface
|
||||
{
|
||||
public function pluck(){
|
||||
return Generator::pluck('name','id');
|
||||
}
|
||||
public function findAll()
|
||||
{
|
||||
return Generator::get();
|
||||
}
|
||||
|
||||
public function getGeneratorById($generatorId)
|
||||
{
|
||||
return Generator::findOrFail($generatorId);
|
||||
}
|
||||
|
||||
public function delete($generatorId)
|
||||
{
|
||||
Generator::destroy($generatorId);
|
||||
}
|
||||
|
||||
public function create(array $generatorDetails)
|
||||
{
|
||||
return Generator::create($generatorDetails);
|
||||
}
|
||||
|
||||
public function update($generatorId, array $newDetails)
|
||||
{
|
||||
return Generator::where('id', $generatorId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user