検索画面のページネーションURLに検索クエリが含まれるよう修正 (#83)

refs #82
This commit is contained in:
shibafu 2019-02-07 21:34:57 +09:00 committed by GitHub
parent 96199c9e46
commit d105568c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,8 @@ class SearchController extends Controller
->where('is_private', false)
->orderBy('ejaculated_date', 'desc')
->with(['user', 'tags'])
->paginate(20);
->paginate(20)
->appends($inputs);
return view('search.index')->with(compact('inputs', 'results'));
}
@ -34,7 +35,8 @@ class SearchController extends Controller
$results = Tag::query()
->where('name', 'like', "%{$inputs['q']}%")
->paginate(50);
->paginate(50)
->appends($inputs);
return view('search.relatedTag')->with(compact('inputs', 'results'));
}