This commit is contained in:
tanch0
2024-06-15 22:23:54 +05:45
parent 8253440371
commit cb99bedac6
144 changed files with 6436 additions and 3112 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace App\Repositories;
use App\Models\Newscategories;
use App\Repositories\Interface\NewsCategoriesInterface;
class NewsCategoriesRepository implements NewsCategoriesInterface
{
public function getAll()
{
return Newscategories::where('status', '<>', -1)->orderBy('display_order')->get();
}
public function getNewsCategoriesById($newsCategoriesId)
{
return Newscategories::findOrFail($newsCategoriesId);
}
public function delete($newsCategoriesId)
{
return Newscategories::destroy($newsCategoriesId);
}
public function create(array $provinceDetails)
{
return Newscategories::create($provinceDetails);
}
public function update($newsCategoriesId, array $newDetails)
{
return Newscategories::where('category_id', $newsCategoriesId)->update($newDetails);
}
}