src/Builders/ModelBuilder.php
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);
    }
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);
    }
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 ) ; }
Builds a source model

@param string $name
@param Collection $fields
Builds a source model