Skip to content

Commit

Permalink
Fixed driver, asset url and auth api driver
Browse files Browse the repository at this point in the history
  • Loading branch information
maab16 committed Feb 1, 2020
1 parent 2e7bc73 commit 4e8d2af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions config/dbm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@

'prefix' => 'database',

/*
|-------------------------------------------------------------
| Database Driver
|-------------------------------------------------------------
|
|
*/

'driver' => 'mysql',

/*
|-------------------------------------------------------------
| Global namespace
Expand Down
8 changes: 8 additions & 0 deletions src/Commands/InstallDatabaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ public function handle(Filesystem $filesystem)
$process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time
$process->setWorkingDirectory(base_path())->run();

// Modify auth api driver token to passport
$auth_config_contents = $filesystem->get(base_path('config/auth.php'));
$auth_config_contents = str_replace('\'token\'', '\'passport\'', $auth_config_contents);
$filesystem->put(
base_path('config/auth.php'),
$auth_config_contents
);

// Load Custom Database Manager routes into application's 'routes/web.php'
$this->info('Adding Database Manager routes');
$web_routes_contents = $filesystem->get(base_path('routes/web.php'));
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
if (! function_exists('dbm_asset')) {
function dbm_asset($path, $secure = null)
{
return route('dbm.asset').'?path='.urlencode($path);
return url(config('dbm.prefix').'/assets?path='.urlencode($path));
}
}

if (! function_exists('dbm_driver')) {
function dbm_driver()
{
return (config('database.default') != '') ? config('database.default') : 'mysql';
return config('dbm.driver', 'mysql');
}
}

Expand Down

0 comments on commit 4e8d2af

Please sign in to comment.