-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathFilamentSyntaxEntryServiceProvider.php
66 lines (55 loc) · 1.7 KB
/
FilamentSyntaxEntryServiceProvider.php
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
61
62
63
64
65
66
<?php
namespace Parallax\FilamentSyntaxEntry;
use Filament\Support\Assets\Asset;
use Filament\Support\Assets\Css;
use Filament\Support\Facades\FilamentAsset;
use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
class FilamentSyntaxEntryServiceProvider extends PackageServiceProvider
{
public static string $name = 'filament-syntax-entry';
public static string $viewNamespace = 'filament-syntax-entry';
public function configurePackage(Package $package): void
{
$package->name(static::$name)
->hasInstallCommand(function (InstallCommand $command) {
$command
->askToStarRepoOnGitHub('parallax/filament-syntax-entry');
});
if (file_exists($package->basePath('/../resources/views'))) {
$package->hasViews(static::$viewNamespace);
}
}
public function packageBooted(): void
{
FilamentAsset::register(
$this->getAssets(),
$this->getAssetPackageName()
);
FilamentAsset::registerScriptData(
$this->getScriptData(),
$this->getAssetPackageName()
);
}
protected function getAssetPackageName(): ?string
{
return 'parallax/filament-syntax-entry';
}
/**
* @return array<Asset>
*/
protected function getAssets(): array
{
return [
Css::make('filament-syntax-entry-styles', __DIR__ . '/../resources/dist/filament-syntax-entry.css'),
];
}
/**
* @return array<string, mixed>
*/
protected function getScriptData(): array
{
return [];
}
}