protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        $this->replaceNamespace($stub, $name)
            ->replaceClassName($stub, $name)
            ->replaceResourceType($stub)
            ->replaceApplicationNamespace($stub)
            ->replaceRecord($stub);

        return $stub;
    }