From 69f212d7053db1309c3cf50c146cfdc2c81357a1 Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 6 Sep 2018 23:48:54 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=AE=E5=88=9D=E6=9C=9F=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/SearchController.php | 41 +++++++ resources/views/layouts/base.blade.php | 19 ++- resources/views/search/base.blade.php | 19 +++ resources/views/search/index.blade.php | 121 ++++++++++++++++++++ resources/views/search/relatedTag.blade.php | 31 +++++ routes/web.php | 6 +- 6 files changed, 231 insertions(+), 6 deletions(-) create mode 100644 app/Http/Controllers/SearchController.php create mode 100644 resources/views/search/base.blade.php create mode 100644 resources/views/search/index.blade.php create mode 100644 resources/views/search/relatedTag.blade.php diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php new file mode 100644 index 0000000..0b7205c --- /dev/null +++ b/app/Http/Controllers/SearchController.php @@ -0,0 +1,41 @@ +validate([ + 'q' => 'required' + ]); + + $results = Ejaculation::query() + ->whereHas('tags', function ($query) use ($inputs) { + $query->where('name', 'like', "%{$inputs['q']}%"); + }) + ->where('is_private', false) + ->orderBy('ejaculated_date', 'desc') + ->with(['user', 'tags']) + ->paginate(20); + + return view('search.index')->with(compact('inputs', 'results')); + } + + public function relatedTag(Request $request) + { + $inputs = $request->validate([ + 'q' => 'required' + ]); + + $results = Tag::query() + ->where('name', 'like', "%{$inputs['q']}%") + ->paginate(50); + + return view('search.relatedTag')->with(compact('inputs', 'results')); + } +} \ No newline at end of file diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 2a1a231..463908e 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -44,21 +44,30 @@ ランキング --}} +
+
+ +
+ +
+
+
+
+ チェックイン +
-
- チェックイン -
@endauth @guest
- +
From af4b60d6e1b243749acd2168cd9e74ce22e9568c Mon Sep 17 00:00:00 2001 From: shibafu Date: Tue, 11 Sep 2018 23:18:15 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Laravel=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AEDeployments=E3=81=AB=E6=9B=B8?= =?UTF-8?q?=E3=81=8B=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=82=B3=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=82=92=E5=AE=9F=E8=A1=8C=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 prepare.sh diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..f98e684 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# https://laravel.com/docs/5.5/deployment +composer install --optimize-autoloader +php artisan config:cache \ No newline at end of file