いいねボタンの追加
This commit is contained in:
@@ -78,7 +78,9 @@ class EjaculationController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$ejaculation = Ejaculation::findOrFail($id);
|
||||
$ejaculation = Ejaculation::where('id', $id)
|
||||
->withLikes()
|
||||
->firstOrFail();
|
||||
$user = User::findOrFail($ejaculation->user_id);
|
||||
|
||||
// 1つ前のチェックインからの経過時間を求める
|
||||
|
@@ -69,6 +69,7 @@ SQL
|
||||
->orderBy('ejaculations.ejaculated_date', 'desc')
|
||||
->select('ejaculations.*')
|
||||
->with('user', 'tags')
|
||||
->withLikes()
|
||||
->take(10)
|
||||
->get();
|
||||
|
||||
|
@@ -21,6 +21,7 @@ class SearchController extends Controller
|
||||
->where('is_private', false)
|
||||
->orderBy('ejaculated_date', 'desc')
|
||||
->with(['user', 'tags'])
|
||||
->withLikes()
|
||||
->paginate(20)
|
||||
->appends($inputs);
|
||||
|
||||
|
@@ -16,6 +16,7 @@ class TimelineController extends Controller
|
||||
->orderBy('ejaculations.ejaculated_date', 'desc')
|
||||
->select('ejaculations.*')
|
||||
->with('user', 'tags')
|
||||
->withLikes()
|
||||
->paginate(21);
|
||||
|
||||
return view('timeline.public')->with(compact('ejaculations'));
|
||||
|
@@ -41,6 +41,7 @@ SQL
|
||||
}
|
||||
$ejaculations = $query->orderBy('ejaculated_date', 'desc')
|
||||
->with('tags')
|
||||
->withLikes()
|
||||
->paginate(20);
|
||||
|
||||
// よく使っているタグ
|
||||
|
Reference in New Issue
Block a user