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);
|
||||
}
|
||||
}
|
35
app/Repositories/HoroscopeRepository.php
Normal file
35
app/Repositories/HoroscopeRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
12
app/Repositories/Interface/ArticleInterface.php
Normal file
12
app/Repositories/Interface/ArticleInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface ArticleInterface
|
||||
{
|
||||
public function getAll();
|
||||
public function getArticleById($artilceId);
|
||||
public function delete($artilceId);
|
||||
public function create(array $artilceDetails);
|
||||
public function update($artilceId, array $newDetails);
|
||||
}
|
12
app/Repositories/Interface/HoroscopeInterface.php
Normal file
12
app/Repositories/Interface/HoroscopeInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface HoroscopeInterface
|
||||
{
|
||||
public function getAll();
|
||||
public function getHoroscopeById($horoscopeId);
|
||||
public function delete($horoscopeId);
|
||||
public function create(array $horoscopeDetails);
|
||||
public function update($horoscopeId, array $newDetails);
|
||||
}
|
9
app/Repositories/Interface/SettingInterface.php
Normal file
9
app/Repositories/Interface/SettingInterface.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface SettingInterface
|
||||
{
|
||||
public function create(array $settingDetails);
|
||||
public function update($settingId, array $newDetails);
|
||||
}
|
12
app/Repositories/Interface/TeamsInterface.php
Normal file
12
app/Repositories/Interface/TeamsInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface TeamsInterface
|
||||
{
|
||||
public function getAll();
|
||||
public function getTeamById($teamId);
|
||||
public function delete($teamId);
|
||||
public function create(array $teamsDetail);
|
||||
public function update($teamId, array $newDetails);
|
||||
}
|
12
app/Repositories/Interface/VideosInterface.php
Normal file
12
app/Repositories/Interface/VideosInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface VideosInterface
|
||||
{
|
||||
public function getAll();
|
||||
public function getVideoById($videoId);
|
||||
public function delete($videoId);
|
||||
public function create(array $videoDetails);
|
||||
public function update($videoId, array $newDetails);
|
||||
}
|
19
app/Repositories/SettingRepository.php
Normal file
19
app/Repositories/SettingRepository.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Settings;
|
||||
use App\Repositories\Interface\SettingInterface;
|
||||
|
||||
class SettingRepository implements SettingInterface
|
||||
{
|
||||
public function create(array $settingDetails)
|
||||
{
|
||||
Settings::create($settingDetails);
|
||||
}
|
||||
|
||||
public function update($settingId, array $newDetails)
|
||||
{
|
||||
return Settings::where('setting_id', $settingId)->update($newDetails);
|
||||
}
|
||||
}
|
33
app/Repositories/TeamsRepository.php
Normal file
33
app/Repositories/TeamsRepository.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Teams;
|
||||
use App\Repositories\Interface\TeamsInterface;
|
||||
|
||||
class TeamsRepository implements TeamsInterface
|
||||
{
|
||||
public function getAll()
|
||||
{
|
||||
return Teams::where('status','<>', -1)->orderBy('display_order')->get();
|
||||
}
|
||||
|
||||
public function getTeamById($teamId)
|
||||
{
|
||||
return Teams::findOrFail($teamId);
|
||||
}
|
||||
|
||||
public function delete($teamId)
|
||||
{
|
||||
return Teams::destroy($teamId);
|
||||
}
|
||||
|
||||
public function create(array $provinceDetails)
|
||||
{
|
||||
return Teams::create($provinceDetails);
|
||||
}
|
||||
|
||||
public function update($teamId, array $newDetails){
|
||||
return Teams::where('team_id', $teamId)->update($newDetails);
|
||||
}
|
||||
}
|
34
app/Repositories/VideoRepository.php
Normal file
34
app/Repositories/VideoRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Videos;
|
||||
use App\Repositories\Interface\VideosInterface;
|
||||
|
||||
|
||||
class VideoRepository implements VideosInterface
|
||||
{
|
||||
public function getAll()
|
||||
{
|
||||
return Videos::where('status','<>', -1)->orderBy('display_order')->get();
|
||||
}
|
||||
|
||||
public function getVideoById($videoId)
|
||||
{
|
||||
return Videos::findOrFail($videoId);
|
||||
}
|
||||
|
||||
public function delete($videoId)
|
||||
{
|
||||
return Videos::destroy($videoId);
|
||||
}
|
||||
|
||||
public function create(array $provinceDetails)
|
||||
{
|
||||
return Videos::create($provinceDetails);
|
||||
}
|
||||
|
||||
public function update($videoId, array $newDetails){
|
||||
return Videos::where('video_id', $videoId)->update($newDetails);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user