src/Resource.php
public static function fromJson(string $json): self
    {
        $input = json_decode($json, true);
        $data = reset($input);
        $locale = key($input);
        
        return new self($locale, $data);
    }
public static function fromJson(string $json): self
    {
        $input = json_decode($json, true);
        $data = reset($input);
        $locale = key($input);
        
        return new self($locale, $data);
    }
public static function fromJson ( string $ json ) : self { $ input = json_decode ( $ json , true ) ; $ data = reset ( $ input ) ; $ locale = key ( $ input ) ; return new self ( $ locale , $ data ) ; }
Factory method to create a translation resource from a JSON string
@param string $json
@return \self
Factory method to create a translation resource from a JSON string