Skip to content

Commit 4e8d2af

Browse files
committed
Fixed driver, asset url and auth api driver
1 parent 2e7bc73 commit 4e8d2af

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

config/dbm.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626

2727
'prefix' => 'database',
2828

29+
/*
30+
|-------------------------------------------------------------
31+
| Database Driver
32+
|-------------------------------------------------------------
33+
|
34+
|
35+
*/
36+
37+
'driver' => 'mysql',
38+
2939
/*
3040
|-------------------------------------------------------------
3141
| Global namespace

src/Commands/InstallDatabaseManager.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public function handle(Filesystem $filesystem)
8484
$process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time
8585
$process->setWorkingDirectory(base_path())->run();
8686

87+
// Modify auth api driver token to passport
88+
$auth_config_contents = $filesystem->get(base_path('config/auth.php'));
89+
$auth_config_contents = str_replace('\'token\'', '\'passport\'', $auth_config_contents);
90+
$filesystem->put(
91+
base_path('config/auth.php'),
92+
$auth_config_contents
93+
);
94+
8795
// Load Custom Database Manager routes into application's 'routes/web.php'
8896
$this->info('Adding Database Manager routes');
8997
$web_routes_contents = $filesystem->get(base_path('routes/web.php'));

src/Helpers/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
if (! function_exists('dbm_asset')) {
44
function dbm_asset($path, $secure = null)
55
{
6-
return route('dbm.asset').'?path='.urlencode($path);
6+
return url(config('dbm.prefix').'/assets?path='.urlencode($path));
77
}
88
}
99

1010
if (! function_exists('dbm_driver')) {
1111
function dbm_driver()
1212
{
13-
return (config('database.default') != '') ? config('database.default') : 'mysql';
13+
return config('dbm.driver', 'mysql');
1414
}
1515
}
1616

0 commit comments

Comments
 (0)