jeudi 25 octobre 2018

'Creating default object from empty value' appears when filtering fields

i am trying to change field label dynamically base on username that starts with specific string

public function filterFields($fields,$context = null)
{
      $nager = WartaDataProfil::where('backend_users_id',$this->getBackendUserId())->pluck('nager');        

      if(Str::startsWith($nager[0],'GP')){            

        $fields->wil->label = "Sektor";
      }

}

i got error Creating default object from empty value from this line $fields->wil->label = "Sektor";

when i dd($fields->wil->label); i got default string which is defined in yaml file..

any ideas.. please kindly help me..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire