예제 #1
0
 public function account(Post $postModel, Images $imgModel)
 {
     $posts = $postModel->getPublishedMyPosts();
     foreach ($posts as $key => $value) {
         $img = $imgModel->getLastPostImg($value['id']);
         $name = '';
         if (isset($img[0])) {
             $name = $img[0]['name'];
         }
         $posts[$key]['img'] = $name;
     }
     //dd($posts);
     $user_id = session('id');
     return view('post.account', ['posts' => $posts, 'user_id' => $user_id]);
 }