Get the top value of array

Context: To give context, I am trying to create a graph with the months as the labels and the number of applications as the dataset.

My code:

$apps = Application::whereBetween('created_at', [
    ->groupBy(function ($val) {
        return Carbon::parse($val->created_at)->format('M');


array:3 [▼
 "Jan" => array:2 [▶]
 "Feb" => array:1 [▶]
 "May" => array:1 [▶]

I want to create an array that produces this result:

['Jan', 'Feb', 'May']

I have tried using array keys, values, etc without any joy.

Read more here:

Content Attribution

This content was originally published by Paolo Resteghini at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: