47 lines
910 B
PHP
47 lines
910 B
PHP
<?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');
|
|
}
|
|
|
|
}
|