mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 05:50:55 +08:00
locale file & thank api
This commit is contained in:
@@ -17,7 +17,11 @@ class CommentController extends Controller
|
||||
{
|
||||
$torrentId = $request->torrent_id;
|
||||
$with = ['create_user', 'update_user'];
|
||||
$comments = Comment::query()->with($with)->where('torrent', $torrentId)->paginate();
|
||||
$comments = Comment::query()
|
||||
->with($with)
|
||||
->where('torrent', $torrentId)
|
||||
->whereHas('create_user')
|
||||
->paginate();
|
||||
$resource = CommentResource::collection($comments);
|
||||
$resource->additional([
|
||||
'page_title' => nexus_trans('comment.index.page_title'),
|
||||
|
||||
@@ -19,6 +19,9 @@ class FileController extends Controller
|
||||
$torrentId = $request->torrent_id;
|
||||
$files = File::query()->where('torrent', $torrentId)->get();
|
||||
$resource = FileResource::collection($files);
|
||||
$resource->additional([
|
||||
'page_title' => nexus_trans('file.index.page_title'),
|
||||
]);
|
||||
|
||||
return $this->success($resource);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,15 @@ class ThankController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
$torrentId = $request->torrent_id;
|
||||
$thanks = Thank::query()->where('torrentid', $torrentId)->with(['user'])->paginate();
|
||||
$thanks = Thank::query()
|
||||
->where('torrentid', $torrentId)
|
||||
->whereHas('user')
|
||||
->with(['user'])
|
||||
->paginate();
|
||||
$resource = ThankResource::collection($thanks);
|
||||
$resource->additional([
|
||||
'page_title' => nexus_trans('thank.index.page_title'),
|
||||
]);
|
||||
|
||||
return $this->success($resource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user