master_template/app/Repositories/VideoRepository.php

35 lines
721 B
PHP
Raw Normal View History

2024-06-18 05:46:51 +00:00
<?php
namespace App\Repositories;
use App\Models\Videos;
2024-06-23 11:17:56 +00:00
use App\Repositories\VideosInterface;
2024-06-18 05:46:51 +00:00
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);
}
}