master_template/app/Repositories/HoroscopeRepository.php

36 lines
800 B
PHP
Raw Normal View History

2024-06-18 05:46:51 +00:00
<?php
namespace App\Repositories;
use App\Models\Horoscopes;
use App\Repositories\Interface\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);
}
}