protected function makeSeeder()
    {
        $path = getcwd().'/tests/DatabaseSeeders';
        $name = $this->getArgument('name');
        $stub = __DIR__.'/../../../stubs/SeederStub.php';
        $content = file_get_contents($stub);
        $content = str_replace('$$CLASS_NAME$$', $name, $content);
        $path = "{$path}/{$name}.php";

        if (file_exists($path)) {
            throw new \Exception("File already exists at $path");
        }

        $done = file_put_contents($path, $content);

        if ($done === false) {
            throw new \Exception("Could not create file at $path");
        }

        return $path;
    }
protected function makeSeeder()
    {
        $path = getcwd().'/tests/DatabaseSeeders';
        $name = $this->getArgument('name');
        $stub = __DIR__.'/../../../stubs/SeederStub.php';
        $content = file_get_contents($stub);
        $content = str_replace('$$CLASS_NAME$$', $name, $content);
        $path = "{$path}/{$name}.php";

        if (file_exists($path)) {
            throw new \Exception("File already exists at $path");
        }

        $done = file_put_contents($path, $content);

        if ($done === false) {
            throw new \Exception("Could not create file at $path");
        }

        return $path;
    }
protected function makeSeeder ( ) { $ path = getcwd ( ) . '/tests/DatabaseSeeders' ; $ name = $ this -> getArgument ( 'name' ) ; $ stub = __DIR__ . '/../../../stubs/SeederStub.php' ; $ content = file_get_contents ( $ stub ) ; $ content = str_replace ( '$$CLASS_NAME$$' , $ name , $ content ) ; $ path = "{$path}/{$name}.php" ; if ( file_exists ( $ path ) ) { throw new \ Exception ( "File already exists at $path" ) ; } $ done = file_put_contents ( $ path , $ content ) ; if ( $ done === false ) { throw new \ Exception ( "Could not create file at $path" ) ; } return $ path ; }
Make a database seeder.

@throws \Exception
Make a database seeder .