File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,6 +200,17 @@ public function getConfigAttribute($value)
200200 */
201201 public function setConfigAttribute ($ value )
202202 {
203+ // quando este método é invocado pelo seeder, $value vem como string JSON
204+ // quando este método é invocado pelo MVC, $value vem como array
205+
206+ if (is_string ($ value )) {
207+ $ value_decoded = json_decode ($ value , true ); // Decodifica como array associativo
208+ if (is_array ($ value_decoded ) && (json_last_error () == JSON_ERROR_NONE )) {
209+ // se $value veio como string JSON, vamos utilizar $value_decoded, de modo a poder acessá-lo mais abaixo como array
210+ $ value = $ value_decoded ;
211+ }
212+ }
213+
203214 $ v = new \StdClass ;
204215 foreach (config ('filas.config.visibilidade ' ) as $ key => $ val ) {
205216 $ v ->$ key = $ value ['visibilidade ' ][$ key ] ?? 0 ;
You can’t perform that action at this time.
0 commit comments