protected function replaceCasts(&$stub, $fields){
        $casts = [];
        foreach ($fields as $f){
            if(!empty($f['casts'])) $casts[] = "\"{$f['name']}\"=>\"{$f['casts']}\"";
        }
        if(count($casts)) $casts = "protected \$casts = [".implode(',',$casts)."];";
        else $casts = "";

        $stub = str_replace('DummyCasts', $casts, $stub);

        return $this;
    }
protected function replaceCasts(&$stub, $fields){
        $casts = [];
        foreach ($fields as $f){
            if(!empty($f['casts'])) $casts[] = "\"{$f['name']}\"=>\"{$f['casts']}\"";
        }
        if(count($casts)) $casts = "protected \$casts = [".implode(',',$casts)."];";
        else $casts = "";

        $stub = str_replace('DummyCasts', $casts, $stub);

        return $this;
    }
protected function replaceCasts ( & $ stub , $ fields ) { $ casts = [ ] ; foreach ( $ fields as $ f ) { if ( ! empty ( $ f [ 'casts' ] ) ) $ casts [ ] = "\"{$f['name']}\"=>\"{$f['casts']}\"" ; } if ( count ( $ casts ) ) $ casts = "protected \$casts = [" . implode ( ',' , $ casts ) . "];" ; else $ casts = "" ; $ stub = str_replace ( 'DummyCasts' , $ casts , $ stub ) ; return $ this ; }
Replace casts dummy.

@param string $stub
@param array  $fields

@return $this
Replace casts dummy .