protected function createTraitFile($trait)
    {
        $dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
        $dir_option = $dir_option ? '\\' . $dir_option : '';
        $trait = $this->configureName('trait', $trait);

        $stub = str_replace(
            ['{{Namespace}}', '{{TraitName}}'],
            [$this->getTraitDirectoryFromConfig() . $dir_option, $trait],
            $this->files->get(__DIR__ . '/../stubs/trait.stub')
        );

        $this->files->put(base_path() . '/' . $this->getTraitDirectory() . $this->getDirOption() . $trait . '.php', $stub);
    }