#add env management
This commit is contained in:
33
app/Providers/EnvServiceProvider.php
Normal file
33
app/Providers/EnvServiceProvider.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use App\Console\Commands\EnvCommand;
|
||||
|
||||
class EnvServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* 注册服务
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// 注册环境管理服务
|
||||
$this->app->singleton(\App\Services\EnvService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动服务
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// 注册Artisan命令
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
EnvCommand::class,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user