StocksNew/Modules/Office/app/Repositories/GeneratorRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

39 lines
780 B
PHP

<?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);
}
}