且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Laravel中按字母顺序对记录进行排序

更新时间:2023-01-30 15:20:26

我改用get(),您无法使用方法all()修改查询,而且它也是静态函数

I use get() instead , you can't modify query with method all() and also it is static function

  $items = Item::orderBy('name')->get();