いいね一覧の追加

This commit is contained in:
shibafu
2019-04-06 00:14:05 +09:00
parent 02f03165d6
commit fe880ee599
4 changed files with 50 additions and 0 deletions

View File

@@ -177,4 +177,23 @@ SQL
return view('user.profile')->with(compact('user', 'ejaculations'));
}
public function likes($name)
{
$user = User::where('name', $name)->first();
if (empty($user)) {
abort(404);
}
if (!$user->isMe()) {
abort(403);
}
$likes = $user->likes()
->orderBy('created_at', 'desc')
->with('ejaculation.user', 'ejaculation.tags')
->paginate(20);
return view('user.likes')->with(compact('user', 'likes'));
}
}