-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppServiceProvider.php
More file actions
43 lines (38 loc) · 1.33 KB
/
Copy pathAppServiceProvider.php
File metadata and controls
43 lines (38 loc) · 1.33 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
42
43
<?php
namespace App\Providers;
use App\Checks\FailedJobsCheck;
use App\Checks\FilesystemsDefaultCheck;
use App\Checks\JobsCheck;
use App\Content\MarkdownContentService;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Spatie\Health\Checks\Checks\CacheCheck;
use Spatie\Health\Checks\Checks\DebugModeCheck;
use Spatie\Health\Checks\Checks\EnvironmentCheck;
use Spatie\Health\Checks\Checks\OptimizedAppCheck;
use Spatie\Health\Facades\Health;
use Spatie\SecurityAdvisoriesHealthCheck\SecurityAdvisoriesCheck;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->app->singleton(MarkdownContentService::class, fn () => new MarkdownContentService(
basePath: config('content.path'),
cacheTtl: (int) config('content.cache_ttl'),
));
}
public function boot(): void
{
View::share('configuration', site_configuration());
Health::checks([
DebugModeCheck::new(),
CacheCheck::new(),
OptimizedAppCheck::new(),
EnvironmentCheck::new()->if(app()->isProduction()),
JobsCheck::new()->everyFiveMinutes(),
FailedJobsCheck::new(),
FilesystemsDefaultCheck::new(),
SecurityAdvisoriesCheck::new()->lastDayOfMonth(),
]);
}
}