Skip to content

Commit

Permalink
fix: app provider
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-shi authored and seth-shi committed Apr 30, 2024
1 parent 914586f commit e74782b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
34 changes: 1 addition & 33 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,7 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
// 如果在后台运行, 启动后台服务
if (request()->is('admin*')) {

$this->registerEditorService();
$this->registerAdminService();
} elseif (request()->is('yxx*')) {

$this->registerEditorService();
} elseif (request()->is('api*')) {

config(['auth.defaults.guard' => 'api']);
$this->registerJwtService();
} elseif ($this->app->runningInConsole()) {

Schema::defaultStringLength(191);
$this->registerJwtService();
$this->registerAdminService();
}
Schema::defaultStringLength(191);
}

/**
Expand All @@ -48,20 +32,4 @@ public function boot()
public function register()
{
}

protected function registerAdminService()
{
AliasLoader::getInstance()->alias('Admin', Admin::class);
$this->app->register(AdminServiceProvider::class);
}

public function registerEditorService()
{
$this->app->register(EditorProvider::class);
}

protected function registerJwtService()
{
$this->app->register(LaravelServiceProvider::class);
}
}
10 changes: 0 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
"jenssegers/agent",
"intervention/image",
"encore/laravel-admin",
"yxx/kindeditor"
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
Expand Down

0 comments on commit e74782b

Please sign in to comment.