36 lines
805 B
PHP
36 lines
805 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\URL;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
if (config('app.env') !== 'local') {
|
|
|
|
URL::forceScheme('https');
|
|
}
|
|
// 註冊 Line 驅動
|
|
\Socialite::extend('line', function ($app) {
|
|
$config = $app['config']['services.line'];
|
|
return new \SocialiteProviders\Line\Provider(
|
|
$app['request'], $config['client_id'], $config['client_secret'], $config['redirect']
|
|
);
|
|
});
|
|
}
|
|
}
|