progress
This commit is contained in:
30
app/Repositories/NewsCategoriesRepository.php
Normal file
30
app/Repositories/NewsCategoriesRepository.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user