StocksNew/Modules/Admin/app/Repositories/WarningRepository.php

36 lines
671 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Warning;
class WarningRepository implements WarningInterface
{
public function findAll()
{
return Warning::get();
}
public function getWarningById($warningId)
{
return Warning::findOrFail($warningId);
}
public function delete($warningId)
{
Warning::destroy($warningId);
}
public function create(array $warningDetails)
{
return Warning::create($warningDetails);
}
public function update($warningId, array $newDetails)
{
return Warning::where('warning_id', $warningId)->update($newDetails);
}
}