middleware( function ($request, $next) { /** @var User $user */ $user = auth()->user(); $this->repository = app(LinkTypeRepositoryInterface::class); $this->repository->setUser($user); return $next($request); } ); } /** * Delete the resource. * * @param TransactionJournalLink $link * * @return JsonResponse * @codeCoverageIgnore */ public function destroy(TransactionJournalLink $link): JsonResponse { $this->repository->destroyLink($link); return response()->json([], 204); } }