質問編集履歴

6

GitHub上のコードの注意点を記述

2018/04/14 14:56

投稿

KIYZ
KIYZ

スコア17

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- ※GitHubで下記以外のファイルのコードもご確認頂けます。
17
+ ※GitHubで下記以外のファイルのコードもご確認頂けます。(問題解決後は更新していきます。)
18
18
 
19
19
  [https://github.com/KIYZ/sns](https://github.com/KIYZ/sns)
20
20
 

5

GitHubリンクを修正

2018/04/14 14:56

投稿

KIYZ
KIYZ

スコア17

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ※GitHubで下記以外のファイルのコードもご確認頂けます。
18
18
 
19
- https://github.com/KIYZ/sns
19
+ [https://github.com/KIYZ/sns](https://github.com/KIYZ/sns)
20
20
 
21
21
 
22
22
 

4

GitHubリポジトリのリンクを追加

2018/04/14 13:05

投稿

KIYZ
KIYZ

スコア17

test CHANGED
File without changes
test CHANGED
@@ -12,6 +12,14 @@
12
12
 
13
13
  ### 現在のコードの状態
14
14
 
15
+
16
+
17
+ ※GitHubで下記以外のファイルのコードもご確認頂けます。
18
+
19
+ https://github.com/KIYZ/sns
20
+
21
+
22
+
15
23
  __UsersController.php__ の `index(){}` を下記のようにしてログイン中のユーザー情報を取得し、配列に入れて __index.blade.php__ に渡しています。
16
24
 
17
25
 

3

show.blade.php (プロフィールページ) のコードを追加しました。

2018/04/14 13:03

投稿

KIYZ
KIYZ

スコア17

test CHANGED
File without changes
test CHANGED
@@ -264,7 +264,67 @@
264
264
 
265
265
  ```
266
266
 
267
-
267
+ __show.blade.php__ (プロフィールページ)
268
+
269
+ ```php
270
+
271
+ @extends('layouts.app')
272
+
273
+
274
+
275
+ @section('content')
276
+
277
+ <div class="row">
278
+
279
+ <aside class="col-xs-4">
280
+
281
+ <div class="panel panel-default">
282
+
283
+ <div class="panel-heading">
284
+
285
+ <h3 class="panel-title">{{ $user->name }}</h3>
286
+
287
+ </div>
288
+
289
+ <div class="panel-body">
290
+
291
+ <img class="media-object img-rounded img-responsive" src="{{ Gravatar::src($user->email, 500) }}" alt="">
292
+
293
+ </div>
294
+
295
+ @include('user_follow.follow_button', ['user' => $user])
296
+
297
+ </div>
298
+
299
+ </aside>
300
+
301
+ <div class="col-xs-8">
302
+
303
+ <ul class="nav nav-tabs nav-justified">
304
+
305
+ <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>
306
+
307
+ <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>
308
+
309
+ <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>
310
+
311
+ <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>
312
+
313
+ </ul>
314
+
315
+ @if (count($microposts) > 0)
316
+
317
+ @include('microposts.microposts', ['microposts' => $microposts])
318
+
319
+ @endif
320
+
321
+ </div>
322
+
323
+ </div>
324
+
325
+ @endsection
326
+
327
+ ```
268
328
 
269
329
 
270
330
 
@@ -340,32 +400,8 @@
340
400
 
341
401
  ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
342
402
 
343
- 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)
344
-
345
-
346
-
347
- 3/4
348
-
349
- ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
350
-
351
- 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)
352
-
353
-
354
-
355
- 2/4
356
-
357
- ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
358
-
359
403
  Undefined variable: auth_user (View: /home/ubuntu/workspace/microposts/resources/views/commons/navbar.blade.php)
360
404
 
361
-
362
-
363
- 1/4
364
-
365
- ErrorException in 2a5576d3a3140862ca55ac1bbbf9bb65 line 20:
366
-
367
- Undefined variable: auth_user
368
-
369
405
  ```
370
406
 
371
407
 

2

タグを追加

2018/04/14 12:55

投稿

KIYZ
KIYZ

スコア17

test CHANGED
File without changes
test CHANGED
File without changes

1

タイトルを変更

2018/04/14 10:03

投稿

KIYZ
KIYZ

スコア17

test CHANGED
@@ -1 +1 @@
1
- LaravelでコントローラーにてEloquentで取得したデータをビューで参照してページへのリンクを生成する方法
1
+ LaravelでコントローラーにてEloquentで取得したデータをビューで参照する方法
test CHANGED
File without changes