我正在try 获取GROUPBY VALUE并成功给出,之后我只需要组列表数组 如何将其存档.
my Code个
$this->StudentList = Student::get();
$data = $this->StudentList->sortBy('date', SORT_NATURAL)->groupby('date');
($data);
GroupBy Result
array:14 [▼
"2024-01-01" => Illuminate\Database\Eloquent\Collection {#1977 ▶}
"2024-01-02" => Illuminate\Database\Eloquent\Collection {#1978 ▶}
"2024-01-03" => Illuminate\Database\Eloquent\Collection {#1979 ▶}
"2024-01-04" => Illuminate\Database\Eloquent\Collection {#1980 ▶}
"2024-01-05" => Illuminate\Database\Eloquent\Collection {#1981 ▶}
]
need this group date like this in array个
array:14 [▼
"2024-01-01"
"2024-01-02"
"2024-01-03"
"2024-01-04"
"2024-01-05"
]
LALAVEL GET组按名称列表