master_template/app/Repositories/HoroscopeRepository.php
2024-06-18 11:31:51 +05:45

36 lines
800 B
PHP

<?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);
}
}