💄 Ajoute la pagination
This commit is contained in:
parent
1a6677b8aa
commit
516d6d1d34
@ -44,7 +44,7 @@ class DashboardController extends Controller
|
|||||||
$image_counts = Post::where('user_id', Auth::user()->getAuthIdentifier())
|
$image_counts = Post::where('user_id', Auth::user()->getAuthIdentifier())
|
||||||
->where('image', '!=', 'null')
|
->where('image', '!=', 'null')
|
||||||
->count();
|
->count();
|
||||||
$posts = Post::where('user_id', $user_id)->orderBy('date_post', 'DESC')->limit(9)->get();
|
$posts = Post::where('user_id', $user_id)->orderBy('date_post', 'DESC')->paginate(9);
|
||||||
$today_post = Post::whereDate('date_post', '=', $today->format('Y-m-d'))
|
$today_post = Post::whereDate('date_post', '=', $today->format('Y-m-d'))
|
||||||
->where('user_id', $user_id)
|
->where('user_id', $user_id)
|
||||||
->count();
|
->count();
|
||||||
|
@ -51,7 +51,7 @@ class ImageController extends Controller
|
|||||||
$posts_with_image = Post::where('user_id', Auth::user()->getAuthIdentifier())
|
$posts_with_image = Post::where('user_id', Auth::user()->getAuthIdentifier())
|
||||||
->where('image', '!=', 'null')
|
->where('image', '!=', 'null')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->paginate(30);
|
->paginate(9);
|
||||||
|
|
||||||
return view('gallery.my', [
|
return view('gallery.my', [
|
||||||
'posts' => $posts_with_image,
|
'posts' => $posts_with_image,
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<?php echo $posts->render(); ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
<?php echo $posts->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
Loading…
Reference in New Issue
Block a user