master_template/app/Repositories/HoroscopeRepository.php
2024-06-23 17:02:56 +05:45

36 lines
790 B
PHP

<?php
namespace App\Repositories;
use App\Models\Horoscopes;
use App\Repositories\HoroscopeInterface;
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);
}
}