protected function getCasts($stub, array $fields)
    {
        $casts = [];
        $indentCount = $this->getIndent($stub, $this->getTemplateVariable('casts'));
        $indent = $this->Indent($indentCount - $this->backspaceCount);
        foreach ($fields as $field) {
            if ($field->isCastable()) {
                $casts[$field->name] = sprintf("%s'%s' => '%s'", $indent, $field->name, $field->castAs);
            }
        }

        return $this->makeArrayString($casts, $indentCount - $this->backspaceCount - 4);
    }
protected function getCasts($stub, array $fields)
    {
        $casts = [];
        $indentCount = $this->getIndent($stub, $this->getTemplateVariable('casts'));
        $indent = $this->Indent($indentCount - $this->backspaceCount);
        foreach ($fields as $field) {
            if ($field->isCastable()) {
                $casts[$field->name] = sprintf("%s'%s' => '%s'", $indent, $field->name, $field->castAs);
            }
        }

        return $this->makeArrayString($casts, $indentCount - $this->backspaceCount - 4);
    }
protected function getCasts ( $ stub , array $ fields ) { $ casts = [ ] ; $ indentCount = $ this -> getIndent ( $ stub , $ this -> getTemplateVariable ( 'casts' ) ) ; $ indent = $ this -> Indent ( $ indentCount - $ this -> backspaceCount ) ; foreach ( $ fields as $ field ) { if ( $ field -> isCastable ( ) ) { $ casts [ $ field -> name ] = sprintf ( "%s'%s' => '%s'" , $ indent , $ field -> name , $ field -> castAs ) ; } } return $ this -> makeArrayString ( $ casts , $ indentCount - $ this -> backspaceCount - 4 ) ; }
Gets the castable fields in a string from a given fields array.

@param string $stub
@param array $fields

@return string
Gets the castable fields in a string from a given fields array .