I am working on Laravel 8 framework, PHP 8 and MariaDB 10.4.17.
I am using paginate()
feature in controller class and {{$variable->links()}}
in .blade.php view file.
When testing the outcome on the browser, I am getting the paginator links and objects scattered.
Here is how I use paginate()
in controller class :
class Homepage extends Controller
{
public function index(){
$data['articles']=Article::orderBy('created_at','DESC')->paginate(1);
return view('front.homepage',$data);
}
Here is how I call pagination in my .blade.php view file :
{{$articles->links()}}
Finally, this is the scattered view I get in browser:
I would be happy to hear from you, if you have any idea why such untidiness occurs and how to correct it?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…