StocksNew/Modules/Setting/app/Repositories/SettingRepository.php

47 lines
910 B
PHP
Raw Normal View History

2024-09-11 06:47:15 +00:00
<?php
namespace Modules\Setting\Repositories;
use Modules\Setting\Models\Setting;
class SettingRepository implements SettingInterface
{
public function findAll()
{
return Setting::when(true, function ($query) {
})->paginate(20);
}
public function getSettingById($SettingId)
{
return Setting::findOrFail($SettingId);
}
public function getSettingByEmail($email)
{
return Setting::where('email', $email)->first();
}
public function delete($SettingId)
{
Setting::destroy($SettingId);
}
public function create($SettingDetails)
{
return Setting::create($SettingDetails);
}
public function update($SettingId, array $newDetails)
{
return Setting::whereId($SettingId)->update($newDetails);
}
public function pluck()
{
return Setting::pluck('title', 'id');
}
}