22
33namespace  QCod \AppSettings \Setting ;
44
5+ use  Illuminate \Support \Arr ;
6+ use  Illuminate \Support \Str ;
57use  Illuminate \Http \Request ;
68use  Illuminate \Support \Facades \Storage ;
79use  QCod \Settings \Setting \SettingStorage ;
@@ -55,14 +57,14 @@ public function get($name, $default = null)
5557        // get the setting and fallback to default value from config 
5658        $ value$ this settingStorage ->get (
5759            $ name
58-             array_get ($ settingField'value ' , $ default
60+             Arr:: get ($ settingField'value ' , $ default
5961        );
6062
6163        // cast the value 
62-         $ outValue$ this castValue (array_get ($ settingField'data_type ' ), $ valuetrue );
64+         $ outValue$ this castValue (Arr:: get ($ settingField'data_type ' ), $ valuetrue );
6365
6466        // check for accessor to run 
65-         if  ($ accessorarray_get ($ settingField'accessor ' )) {
67+         if  ($ accessorArr:: get ($ settingField'accessor ' )) {
6668            $ outValue$ this runCallback ($ accessor$ name$ value
6769        }
6870
@@ -79,12 +81,12 @@ public function get($name, $default = null)
7981    public  function  set ($ name$ value
8082    {
8183        $ settingField$ this getSettingField ($ name
82-         $ dataTypearray_get ($ settingField'data_type ' );
84+         $ dataTypeArr:: get ($ settingField'data_type ' );
8385
8486        $ val$ this castValue ($ dataType$ value
8587
8688        // check for mutator to run 
87-         if  ($ mutatorarray_get ($ settingField'mutator ' )) {
89+         if  ($ mutatorArr:: get ($ settingField'mutator ' )) {
8890            $ val$ this runCallback ($ mutator$ name$ value
8991        }
9092
@@ -142,7 +144,7 @@ public function loadConfig($config)
142144        array_walk_recursive ($ configfunction  (&$ value$ key
143145            if  (!in_array ($ key'mutator ' , 'accessor ' , 'rules ' ]) && is_callable ($ value
144146                // skip any string which dont look like namesapce 
145-                 if  (is_string ($ valuestr_contains ($ value'\\' ) == false ) {
147+                 if  (is_string ($ valueStr:: contains ($ value'\\' ) == false ) {
146148                    return ;
147149                }
148150
@@ -171,7 +173,7 @@ protected function getSettingUISections()
171173    public  function  getAllSettingFields ()
172174    {
173175        return  $ this getSettingUISections ()->flatMap (function  ($ field
174-             return  array_get ($ field'inputs ' , []);
176+             return  Arr:: get ($ field'inputs ' , []);
175177        });
176178    }
177179
@@ -185,7 +187,7 @@ public function getSettingField($name)
185187    {
186188        return  $ this getAllSettingFields ()
187189            ->first (function  ($ fielduse  ($ name
188-                 return  array_get ($ field'name ' ) == $ name
190+                 return  Arr:: get ($ field'name ' ) == $ name
189191            }, []);
190192    }
191193
@@ -301,11 +303,11 @@ private function castToArray($value, $out)
301303     */ 
302304    private  function  uploadFile ($ setting$ request
303305    {
304-         $ settingNamearray_get ($ setting'name ' );
306+         $ settingNameArr:: get ($ setting'name ' );
305307
306308        // get the disk and path to upload 
307-         $ diskarray_get ($ setting'disk ' , 'public ' );
308-         $ patharray_get ($ setting'path ' , '/ ' );
309+         $ diskArr:: get ($ setting'disk ' , 'public ' );
310+         $ pathArr:: get ($ setting'path ' , '/ ' );
309311
310312        $ uploadedPathnull ;
311313        $ oldFile$ this get ($ settingName
0 commit comments