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'; } }