From 429dc7c7a7299a89b67f785290e9079ec69a63d3 Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 23 Oct 2016 12:19:19 +0800 Subject: [PATCH] fix using array as class contant --- app/Models/Player.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Player.php b/app/Models/Player.php index f7a545a9..8ab7adbb 100644 --- a/app/Models/Player.php +++ b/app/Models/Player.php @@ -25,7 +25,7 @@ class Player extends Model /** * Set of models. */ - const MODELS = ['steve', 'alex', 'cape']; + protected static $models = ['steve', 'alex', 'cape']; /** * Properties for Eloquent Model. @@ -65,7 +65,7 @@ class Player extends Model if ($type == "skin") $type = ($this->getPreference() == "default") ? "steve" : "alex"; - if (in_array($type, self::MODELS)) { + if (in_array($type, self::$models)) { return Texture::find($this["tid_$type"])['hash']; } @@ -80,7 +80,7 @@ class Player extends Model */ public function setTexture(Array $tids) { - foreach (self::MODELS as $model) { + foreach (self::$models as $model) { $property = "tid_$model"; if (isset($tids[$property])) {