forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppServiceProvider.php
More file actions
41 lines (34 loc) · 1.04 KB
/
AppServiceProvider.php
File metadata and controls
41 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace App\Providers;
use App\Services\SystemChecker;
use Illuminate\Foundation\Console\AboutCommand;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
if ($this->app->isLocal()) {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
$this->app->register(TelescopeServiceProvider::class);
}
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
if (config('app.force_https')) {
URL::forceScheme('https');
}
$system = new SystemChecker;
AboutCommand::add('Speedtest Tracker', fn () => [
'Version' => $system->getLocalVersion(),
'Out of date' => $system->isOutOfDate() ? 'Yes' : 'No',
]);
}
}