Commit 65a9d889 authored by Nadchanon Susutlertpanya(บิว)'s avatar Nadchanon Susutlertpanya(บิว)
Browse files

no message

No related merge requests found
Showing with 24 additions and 30 deletions
+24 -30
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Post;
use DB;
use App\Page;
use App\User;
use App\Http\Requests\StorePostRequest;
......@@ -25,11 +26,14 @@ class PostController extends Controller
}
])
->orderBy('updated_at', 'desc')
->paginate(20);
->paginate(1);
$pages = Page::where('status',true)->paginate(10);
$pages = Page::where('status',true)->with('followByUsers')->paginate(5)->sortByDesc(function($page){
return $page->followByUsers->count();
});
$user_id = Auth::User()->id;
foreach ($posts as $post) {
if ($post->likeByUsers) {
......
......@@ -72,7 +72,7 @@
</div>
@if($post->user->id == Auth::User()->id)
<div class="dropdown pull-right">
<div class="dropdown pull-right">
<div class="dropdown-toggle" id="dropdownEditMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<a href=""><i class="glyphicon glyphicon-chevron-down"></i></a>
</div>
......
<div class="col-lg-2">
<div class="panel panel-primary" >
<div class="panel-heading">
<h3 class="panel-title"> Page List</h3>
</div>
<div class="panel-body" id="">
@foreach ($pages as $page)
<p class="list-page" >
<a href="{{ url('/page/'.$page->id) }}" >
<img src="{{ $page->image }}" alt="profile image {{ $post->name }}"
class="list-page-image">
{{$page->name }}
</a>
<div class="panel panel-primary" >
<div class="panel-heading">
<h3 class="panel-title"> Page List</h3>
</div>
<div class="panel-body" id="">
@foreach ($pages as $page)
<p class="list-page" >
<a href="{{ url('/page/'.$page->id) }}" >
<img src="{{ $page->image }}" alt="profile image {{ $post->name }}"
class="list-page-image">
{{$page->name }}
</a>
</p>
@endforeach
<center>
<a href="#" onclick="allPage()" data-toggle="modal" data-target="#popup_allpage">More Page</a>
</center>
</center>
</div>
</div>
</div>
</div>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment