diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 5bdc9b5..04aed97 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -188,6 +188,10 @@ SQL $likes = $user->likes() ->orderBy('created_at', 'desc') ->with('ejaculation.user', 'ejaculation.tags') + ->whereHas('ejaculation', function ($query) { + $query->where('user_id', Auth::id()) + ->orWhere('is_private', false); + }) ->paginate(20); return view('user.likes')->with(compact('user', 'likes')); diff --git a/resources/views/components/ejaculation.blade.php b/resources/views/components/ejaculation.blade.php index 7b76bcf..cda134b 100644 --- a/resources/views/components/ejaculation.blade.php +++ b/resources/views/components/ejaculation.blade.php @@ -6,8 +6,11 @@ -@if ($ejaculation->tags->isNotEmpty()) +@if ($ejaculation->is_private || $ejaculation->tags->isNotEmpty())

+ @if ($ejaculation->is_private) + 非公開 + @endif @foreach ($ejaculation->tags as $tag) {{ $tag->name }} @endforeach