37 lines
771 B
PHP
37 lines
771 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Services\LinkosService;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
// 注册 LinkOS 服务
|
|
$this->app->singleton(LinkosService::class, function ($app) {
|
|
$config = $app['config']->get('services.linkos', []);
|
|
|
|
return new LinkosService($config['key'] ?? '', $config['secret'] ?? '');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
//
|
|
Schema::defaultStringLength(191);
|
|
}
|
|
}
|