48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
namespace App\Domains\Virtual\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use App\Domains\Virtual\Providers\RouteServiceProvider;
|
|
use App\Domains\Virtual\Handler\AuthCompanyCheckAccount;
|
|
use Illuminate\Database\Eloquent\Factory as EloquentFactory;
|
|
|
|
class VirtualServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* 引导启动任何应用程序服务
|
|
*
|
|
* php artisan make:migration --path=app/Domains/Virtual/Database/migrations
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
$this->loadMigrationsFrom([realpath(__DIR__ . '/../Database/migrations')]);
|
|
// $this->app->make(EloquentFactory::class)->load(realpath(__DIR__ . '/../Database/factories'));
|
|
// $this->mergeConfigFrom(realpath(__DIR__ . '/../config.php'), 'domain.virtual');
|
|
|
|
$this->commands([
|
|
\App\Domains\Virtual\Commands\Sync\CompanySync::class,
|
|
\App\Domains\Virtual\Commands\Sync\PackageSync::class,
|
|
\App\Domains\Virtual\Commands\Sync\ProductSync::class,
|
|
\App\Domains\Virtual\Commands\Sync\CardSync::class,
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* 注册一个服务提供者
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->app->bind('auth:company:check:account', function () {
|
|
return new AuthCompanyCheckAccount();
|
|
});
|
|
|
|
$this->app->tag(['auth:company:check:account'], 'auth:company:check');
|
|
|
|
$this->app->register(RouteServiceProvider::class);
|
|
}
|
|
}
|