Skip to content

Commit 698dbd7

Browse files
committed
change redirect to /admin/dashboard
Took 7 minutes
1 parent afa54a5 commit 698dbd7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Commands/InstallCommand.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function handle(): int
7979
copy(__DIR__ . '/../../database/seeders/DatabaseSeeder.php', base_path('database/seeders/DatabaseSeeder.php'));
8080

8181
$this->installMiddlewareAfter('SubstituteBindings::class', '\App\Http\Middleware\SetLocale::class');
82+
$this->replaceInFile('/dashboard', '/admin/dashboard', app_path('Providers/RouteServiceProvider.php'));
8283
$this->info('Your application is ready!');
8384
$this->info('Please run the following command');
8485
$this->info('npm i && npm run dev');
@@ -115,4 +116,17 @@ protected function installMiddlewareAfter($after, $name, $group = 'web')
115116
), LOCK_EX);
116117
}
117118
}
119+
120+
/**
121+
* Replace a given string within a given file.
122+
*
123+
* @param string $search
124+
* @param string $replace
125+
* @param string $path
126+
* @return void
127+
*/
128+
protected function replaceInFile($search, $replace, $path)
129+
{
130+
file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));
131+
}
118132
}

0 commit comments

Comments
 (0)