Laravel 8 分页无法正确加载

时间:2021-06-23 06:45:54

标签: php css laravel pagination laravel-8

我想为我的页面使用分页,所以我在控制器中添加了这个:

$suspendeds = Order::where('status', 'awaiting')->latest()->paginate(1); return view('profile.index', compact('suspendeds'));

在刀锋上:

{{ $suspendeds->links() }}

但不知何故它看起来像这样:

enter image description here

所以我的问题是,如何正确加载此分页?我需要更改 CSS 样式还是由于 Laravel 的原因?如果这个问题可以在 CSS 中解决,类的名称是什么?

2 个答案:

答案 0 :(得分:4)

检查这个https://laravel.com/docs/8.x/pagination#using-bootstrap

use Illuminate\Pagination\Paginator;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    Paginator::useBootstrap();
}

答案 1 :(得分:1)

render() 放在内容结束位置的末尾:

<section class="content">
   <div class="row">

   </div>
   {!! $suspendeds->render() !!}    
</section>