Skip to content

Commit

Permalink
Make installing on Windows work (#5280)
Browse files Browse the repository at this point in the history
* Make installing on Windows work

* Replace new-lines in routes

* Update InstallCommand.php

* Update InstallCommand.php

* Remove trailing comma
  • Loading branch information
emptynick committed May 1, 2021
1 parent 37f45d7 commit e22d212
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function handle(Filesystem $filesystem)
if (false === strpos($routes_contents, 'Voyager::routes()')) {
$filesystem->append(
base_path('routes/web.php'),
"\n\nRoute::group(['prefix' => 'admin'], function () {\n Voyager::routes();\n});\n"
PHP_EOL.PHP_EOL."Route::group(['prefix' => 'admin'], function () {".PHP_EOL." Voyager::routes();".PHP_EOL."});".PHP_EOL
);
}

Expand Down Expand Up @@ -173,10 +173,9 @@ private function addNamespaceIfNeeded($seeds, Filesystem $filesystem)

$seeds->each(function ($file) use ($filesystem) {
$path = database_path('seeders').'/'.$file->getFilename();

$stub = str_replace(
"<?php\n\nuse",
"<?php\n\nnamespace Database\\Seeders;\n\nuse",
["<?php\n\nuse", "<?php".PHP_EOL.PHP_EOL."use"],
"<?php".PHP_EOL.PHP_EOL."namespace Database\\Seeders;".PHP_EOL.PHP_EOL."use",
$filesystem->get($path)
);

Expand Down

0 comments on commit e22d212

Please sign in to comment.