mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 02:07:56 -04:00
36 lines
774 B
PHP
36 lines
774 B
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Repositories;
|
|
|
|
use Modules\StudioPlus\Entities\WatermarkingJob;
|
|
use Modules\StudioPlus\Transformers\WatermarkingJobResource;
|
|
|
|
class WatermarkingJobsRepository
|
|
{
|
|
public function getAll()
|
|
{
|
|
return WatermarkingJob::with('video')->whereHas('video')->latest()->take(20)->get();
|
|
}
|
|
|
|
public function getCollection()
|
|
{
|
|
$items = $this->getAll();
|
|
|
|
return WatermarkingJobResource::collection($items);
|
|
}
|
|
|
|
public function deleteCompleted()
|
|
{
|
|
WatermarkingJob::where('status', 'completed')->delete();
|
|
|
|
return true;
|
|
}
|
|
|
|
public function delete(int $id)
|
|
{
|
|
WatermarkingJob::where('id', $id)->delete();
|
|
|
|
return true;
|
|
}
|
|
}
|