Dingo\Blueprint\Blueprint::appendAttributes PHP Method

appendAttributes() protected method

Append the attributes subsection to a resource or action.
protected appendAttributes ( string &$contents, Collection $attributes, integer $indent ) : void
$contents string
$attributes Illuminate\Support\Collection
$indent integer
return void
    protected function appendAttributes(&$contents, Collection $attributes, $indent = 0)
    {
        $this->appendSection($contents, 'Attributes', $indent);
        $attributes->each(function ($attribute) use(&$contents, $indent) {
            $contents .= $this->line();
            $contents .= $this->tab(1 + $indent);
            $contents .= sprintf('+ %s', $attribute->identifier);
            if ($attribute->sample) {
                $contents .= sprintf(': %s', $attribute->sample);
            }
            $contents .= sprintf(' (%s, %s) - %s', $attribute->type, $attribute->required ? 'required' : 'optional', $attribute->description);
        });
    }