public static function firstByName(string $tag, string $group = null, string $locale = null)
    {
        $locale = $locale ?? app()->getLocale();

        return static::query()->where("name->{$locale}", $tag)->when($group, function (Builder $builder) use ($group) {
            return $builder->where('group', $group);
        })->first();
    }
public static function firstByName(string $tag, string $group = null, string $locale = null)
    {
        $locale = $locale ?? app()->getLocale();

        return static::query()->where("name->{$locale}", $tag)->when($group, function (Builder $builder) use ($group) {
            return $builder->where('group', $group);
        })->first();
    }
public static function firstByName ( string $ tag , string $ group = null , string $ locale = null ) { $ locale = $ locale ?? app ( ) -> getLocale ( ) ; return static :: query ( ) -> where ( "name->{$locale}" , $ tag ) -> when ( $ group , function ( Builder $ builder ) use ( $ group ) { return $ builder -> where ( 'group' , $ group ) ; } ) -> first ( ) ; }
Get first tag by name.

@param string      $tag
@param string|null $group
@param string|null $locale

@return static|null
Get first tag by name .