public function cleanArrayKeysRecursive($dirty)
    {
        if (is_array($dirty instanceof Collection ? $dirty->toArray() : $dirty)) {
            return collect($dirty)->mapWithKeys(function ($item, $key) {
                return [
                    $this->file->cleanKey($key) => $this->cleanArrayKeysRecursive($item),
                ];
            });
        }

        return $dirty;
    }
public function cleanArrayKeysRecursive($dirty)
    {
        if (is_array($dirty instanceof Collection ? $dirty->toArray() : $dirty)) {
            return collect($dirty)->mapWithKeys(function ($item, $key) {
                return [
                    $this->file->cleanKey($key) => $this->cleanArrayKeysRecursive($item),
                ];
            });
        }

        return $dirty;
    }
public function cleanArrayKeysRecursive ( $ dirty ) { if ( is_array ( $ dirty instanceof Collection ? $ dirty -> toArray ( ) : $ dirty ) ) { return collect ( $ dirty ) -> mapWithKeys ( function ( $ item , $ key ) { return [ $ this -> file -> cleanKey ( $ key ) => $ this -> cleanArrayKeysRecursive ( $ item ) , ] ; } ) ; } return $ dirty ; }
Remove extension from file name.

@param $dirty

@return \Illuminate\Support\Collection|mixed
Remove extension from file name .