master_template/app/Repositories/HoroscopeRepository.php

36 lines
790 B
PHP
Raw Normal View History

2024-06-18 05:46:51 +00:00
<?php
namespace App\Repositories;
use App\Models\Horoscopes;
2024-06-23 11:17:56 +00:00
use App\Repositories\HoroscopeInterface;
2024-06-18 05:46:51 +00:00
class HoroscopeRepository implements HoroscopeInterface
{
public function getAll()
{
return Horoscopes::where('status', '<>', -1)->orderBy('display_order')->get();
}
public function getHoroscopeById($horoscopeId)
{
return Horoscopes::findOrFail($horoscopeId);
}
public function delete($horoscopeId)
{
return Horoscopes::destroy($horoscopeId);
}
public function create(array $provinceDetails)
{
return Horoscopes::create($provinceDetails);
}
public function update($horoscopeId, array $newDetails)
{
return Horoscopes::where('horoscope_id', $horoscopeId)->update($newDetails);
}
}