mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-14 09:01:42 -04:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Http\Controllers\API;
|
|
|
|
//use App\Events\TestEvent;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Routing\Controller;
|
|
use Modules\StudioPlus\Events\TestEvent;
|
|
use Modules\StudioPlus\Repositories\WatermarkingJobsRepository;
|
|
|
|
class WatermarkingJobsController extends Controller
|
|
{
|
|
protected $repository;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->repository = new WatermarkingJobsRepository();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
return $this->repository->getCollection();
|
|
}
|
|
|
|
public function deleteCompleted()
|
|
{
|
|
$this->repository->deleteCompleted();
|
|
$jobs = $this->repository->getCollection();
|
|
|
|
return response()->json([
|
|
'message' => 'Completed jobs has been deleted from the queue.',
|
|
'jobs' => $jobs,
|
|
]);
|
|
}
|
|
|
|
public function delete(Request $request)
|
|
{
|
|
$this->repository->delete($request->input('id'));
|
|
$jobs = $this->repository->getCollection();
|
|
|
|
return response()->json([
|
|
'message' => 'Job has been deleted from the queue.',
|
|
'jobs' => $jobs,
|
|
]);
|
|
}
|
|
|
|
public function testEvent()
|
|
{
|
|
event(new TestEvent());
|
|
|
|
return 'testing';
|
|
}
|
|
}
|