public function build($name, Collection $fields = null)
    {
        $path = $this->getClassFilePath($name);
        $tableName = source_table_name($name);

        $contents = view('_hierarchy::entities.model', [
            'tableName'        => $tableName,
            'name'             => $this->getClassName($name),
            'fields'           => $this->makeFields($fields),
            'searchableFields' => $this->makeSearchableFields($fields, $tableName),
            'mutatables'       => $this->makeMutatableFields($fields)
        ])->render();

        $this->write($path, $contents);
    }