title: How do I get the highest property from a laravel eloquent object
body: <p>consider the following Model Object:</p>
  
  <pre><code>App\Modules\CharacterSheets\Models\CharacterSheet {#826
    ...
    #attributes: array:39 [
      "id" =&gt; 1
      "user_id" =&gt; 1
      "race_id" =&gt; 1
      "class_id" =&gt; null
      "strength" =&gt; 35
      "dexterity" =&gt; 35
      "agility" =&gt; 55
      "intelligence" =&gt; 30
      "health" =&gt; 120
      "haste" =&gt; 0
      "precision" =&gt; 0
      "dodge" =&gt; 0
      "crit" =&gt; 0
      "steal_health" =&gt; 5
      "gold" =&gt; 0
      "deffense" =&gt; 7
      "damage" =&gt; 10
      "cast_damage" =&gt; 10
      "antique_damage" =&gt; 0
      "heal_for" =&gt; 10
      "level" =&gt; 1
      "train_exp" =&gt; 0
      "level_exp" =&gt; 200
      "location" =&gt; "0, 0"
      "next_level_exp" =&gt; 1000
      "next_train_level_exp" =&gt; 300
      "max_level" =&gt; 500
      "armor_class" =&gt; 17
      "block_bonus" =&gt; 3
      "hit_bonus" =&gt; 2
      "has_to_train" =&gt; 0
      "primary_attack_stat" =&gt; "health"
      "primary_attack_bonus" =&gt; "2.00"
      "penalty_stat" =&gt; null
      "penalty" =&gt; null
      "damage_subtraction" =&gt; null
      "chance_to_attack_twice" =&gt; null
      "created_at" =&gt; "2019-02-16 01:26:04"
      "updated_at" =&gt; "2019-02-16 01:56:42"
    ]
    ...
  }
  </code></pre>
  
  <p>What I would like to do, <strong>dynamically</strong>, is check which of the following stats are the highest: <code>strength</code>, <code>dexterity</code>, <code>agility</code>, <code>intelligence</code>, <code>health</code></p>
  
  <p>I want to keep the object as is, but return the property name as a string</p>
  
  <p>So for example with the above object, I should have function that returns <code>health</code>.</p>
  
  <p><strong>Again this has to be dynamic</strong>.</p>
  
  <p>I didn't see any laravel collection methods that would do this, so I am asking here as I have no idea how to do this.</p>