forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilamentServiceProvider.php
More file actions
60 lines (53 loc) · 1.83 KB
/
FilamentServiceProvider.php
File metadata and controls
60 lines (53 loc) · 1.83 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace App\Providers;
use App\Settings\GeneralSettings;
use Filament\Facades\Filament;
use Filament\Navigation\NavigationItem;
use FilamentVersions\Facades\FilamentVersions;
use Illuminate\Support\ServiceProvider;
class FilamentServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}
/**
* Bootstrap services.
*/
public function boot(): void
{
try {
config(['filament.brand' => app(GeneralSettings::class)->site_name ?? config('app.name')]);
} catch (\Throwable $th) {
// if this fails it's because the migration doesn't exist so it can be skipped
}
FilamentVersions::addItem('Speedtest Tracker', 'v'.config('speedtest.build_version'));
Filament::serving(function () {
Filament::registerNavigationGroups([
'Settings',
'System',
'Links',
]);
Filament::registerNavigationItems([
NavigationItem::make('Documentation')
->url('https://docs.speedtest-tracker.dev/', shouldOpenInNewTab: true)
->icon('heroicon-o-book-open')
->group('Links')
->sort(0),
NavigationItem::make('Donate')
->url('https://github.com/sponsors/alexjustesen', shouldOpenInNewTab: true)
->icon('heroicon-o-cash')
->group('Links')
->sort(1),
NavigationItem::make('Source Code')
->url('https://github.com/alexjustesen/speedtest-tracker', shouldOpenInNewTab: true)
->icon('heroicon-o-code')
->group('Links')
->sort(2),
]);
});
}
}