我的表列由html标记组成。通常情况下,排序优先选择标记。我想在排序时忽略html标记//示例代码$data=$model->sortby('name')->get();
kyvafyod1#
https://laravel.com/docs/5.7/collections#method-索特比
$sorted = $data->sortBy(function ($item) { return strip_tags($item->name); });
1条答案
按热度按时间kyvafyod1#
https://laravel.com/docs/5.7/collections#method-索特比