updatea
This commit is contained in:
35
app/Repositories/ArticleRepository.php
Normal file
35
app/Repositories/ArticleRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Articles;
|
||||
use App\Repositories\Interface\ArticleInterface;
|
||||
|
||||
|
||||
class ArticleRepository implements ArticleInterface
|
||||
{
|
||||
public function getAll()
|
||||
{
|
||||
return Articles::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
}
|
||||
|
||||
public function getArticleById($artilceId)
|
||||
{
|
||||
return Articles::findOrFail($artilceId);
|
||||
}
|
||||
|
||||
public function delete($artilceId)
|
||||
{
|
||||
return Articles::destroy($artilceId);
|
||||
}
|
||||
|
||||
public function create(array $provinceDetails)
|
||||
{
|
||||
return Articles::create($provinceDetails);
|
||||
}
|
||||
|
||||
public function update($artilceId, array $newDetails)
|
||||
{
|
||||
return Articles::where('article_id', $artilceId)->update($newDetails);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user