質問編集履歴
6
GitHub上のコードの注意点を記述
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
### 現在のコードの状態
|
8
8
|
|
9
|
-
※GitHubで下記以外のファイルのコードもご確認頂けます。
|
9
|
+
※GitHubで下記以外のファイルのコードもご確認頂けます。(問題解決後は更新していきます。)
|
10
10
|
[https://github.com/KIYZ/sns](https://github.com/KIYZ/sns)
|
11
11
|
|
12
12
|
__UsersController.php__ の `index(){}` を下記のようにしてログイン中のユーザー情報を取得し、配列に入れて __index.blade.php__ に渡しています。
|
5
GitHubリンクを修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
### 現在のコードの状態
|
8
8
|
|
9
9
|
※GitHubで下記以外のファイルのコードもご確認頂けます。
|
10
|
-
https://github.com/KIYZ/sns
|
10
|
+
[https://github.com/KIYZ/sns](https://github.com/KIYZ/sns)
|
11
11
|
|
12
12
|
__UsersController.php__ の `index(){}` を下記のようにしてログイン中のユーザー情報を取得し、配列に入れて __index.blade.php__ に渡しています。
|
13
13
|
|
4
GitHubリポジトリのリンクを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
### 現在のコードの状態
|
8
|
+
|
9
|
+
※GitHubで下記以外のファイルのコードもご確認頂けます。
|
10
|
+
https://github.com/KIYZ/sns
|
11
|
+
|
8
12
|
__UsersController.php__ の `index(){}` を下記のようにしてログイン中のユーザー情報を取得し、配列に入れて __index.blade.php__ に渡しています。
|
9
13
|
|
10
14
|
|
3
show.blade.php (プロフィールページ) のコードを追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -131,7 +131,37 @@
|
|
131
131
|
</nav>
|
132
132
|
</header>
|
133
133
|
```
|
134
|
+
__show.blade.php__ (プロフィールページ)
|
135
|
+
```php
|
136
|
+
@extends('layouts.app')
|
134
137
|
|
138
|
+
@section('content')
|
139
|
+
<div class="row">
|
140
|
+
<aside class="col-xs-4">
|
141
|
+
<div class="panel panel-default">
|
142
|
+
<div class="panel-heading">
|
143
|
+
<h3 class="panel-title">{{ $user->name }}</h3>
|
144
|
+
</div>
|
145
|
+
<div class="panel-body">
|
146
|
+
<img class="media-object img-rounded img-responsive" src="{{ Gravatar::src($user->email, 500) }}" alt="">
|
147
|
+
</div>
|
148
|
+
@include('user_follow.follow_button', ['user' => $user])
|
149
|
+
</div>
|
150
|
+
</aside>
|
151
|
+
<div class="col-xs-8">
|
152
|
+
<ul class="nav nav-tabs nav-justified">
|
153
|
+
<li role="presentation" class="{{ Request::is('users/' . $user->id) ? 'active' : '' }}"><a href="{{ route('users.show', ['id' => $user->id]) }}">Microposts <span class="badge">{{ $count_microposts }}</span></a></li>
|
154
|
+
<li role="presentation" class="{{ Request::is('users/*/followings') ? 'active' : '' }}"><a href="{{ route('users.followings', ['id' => $user->id]) }}">Followings <span class="badge">{{ $count_followings }}</span></a></li>
|
155
|
+
<li role="presentation" class="{{ Request::is('users/*/followers') ? 'active' : '' }}"><a href="{{ route('users.followers', ['id' => $user->id]) }}">Followers <span class="badge">{{ $count_followers }}</span></a></li>
|
156
|
+
<li role="presentation" class="{{ Request::is('users/*/favorites') ? 'active' : '' }}"><a href="{{ route('micropost.favorites', ['id' => $user->id]) }}">Favorites <span class="badge">{{ $count_favorites }}</span></a></li>
|
157
|
+
</ul>
|
158
|
+
@if (count($microposts) > 0)
|
159
|
+
@include('microposts.microposts', ['microposts' => $microposts])
|
160
|
+
@endif
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
@endsection
|
164
|
+
```
|
135
165
|
|
136
166
|
__routes.php__
|
137
167
|
```php
|
@@ -169,19 +199,7 @@
|
|
169
199
|
```
|
170
200
|
4/4
|
171
201
|
ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
|
172
|
-
Undefined variable: auth_user (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php) (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php) (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php)
|
173
|
-
|
174
|
-
3/4
|
175
|
-
ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
|
176
|
-
Undefined variable: auth_user (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php) (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php)
|
177
|
-
|
178
|
-
2/4
|
179
|
-
ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
|
180
202
|
Undefined variable: auth_user (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php)
|
181
|
-
|
182
|
-
1/4
|
183
|
-
ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
|
184
|
-
Undefined variable: auth_user
|
185
203
|
```
|
186
204
|
|
187
205
|
### 試したこと
|
2
タグを追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
タイトルを変更
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
LaravelでコントローラーにてEloquentで取得したデータをビューで参照
|
1
|
+
LaravelでコントローラーにてEloquentで取得したデータをビューで参照する方法
|
body
CHANGED
File without changes
|