Skip to content

Commit

Permalink
chore: document templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Oct 21, 2022
1 parent f797eb6 commit 7071837
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/Commands/stubs/route-provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace $NAMESPACE$\Providers;

use Fresns\PluginManager\Models\Plugin;
use Fresns\MarketManager\Models\Plugin;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as BaseServiceProvider;

Expand All @@ -27,11 +27,15 @@ class RouteServiceProvider extends BaseServiceProvider
*/
public function map()
{
$host = null;

try {
$pluginHost = Plugin::findByUnikey('Market')?->plugin_host;
$host = str_replace(['http://', 'https://'], '', rtrim($pluginHost, '/'));
if (class_exists(Plugin::class)) {
$pluginHost = Plugin::findByUnikey('Market')?->plugin_host;
$host = str_replace(['http://', 'https://'], '', rtrim($pluginHost, '/'));
}
} catch (\Throwable $e) {
$host = null;
info("get plugin host failed: " . $e->getMessage());
}

Route::group([
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/stubs/sql-provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SqlLogServiceProvider extends ServiceProvider
return;
}

$this->app['config']->set('logging.channels.sql', config('logging.channels.daily'));
$this->app['config']->set('logging.channels.sql', config('logging.channels.daily', 2));
$this->app['config']->set('logging.channels.sql.path', storage_path('logs/sql.log'));

DB::listen(function (QueryExecuted $query) {
Expand Down

0 comments on commit 7071837

Please sign in to comment.