StocksNew/Modules/Office/app/Repositories/GeneratorRepository.php

39 lines
780 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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);
}
}