forked from askerakbar/gpt-trix-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGptTrixEditorServiceProvider.php
54 lines (42 loc) · 1.16 KB
/
GptTrixEditorServiceProvider.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
<?php
namespace AskerAkbar\GptTrixEditor;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Filament\Support\Assets\Asset;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\Assets\Js;
use Filament\Support\Assets\Css;
use Filament\Support\Assets\AlpineComponent;
class GptTrixEditorServiceProvider extends PackageServiceProvider
{
public static string $name = 'gpt-trix-editor';
public function configurePackage(Package $package): void
{
$package
->name(static::$name)
->hasViews()
->hasConfigFile()
->hasTranslations();
}
public function boot()
{
parent::boot();
}
public function packageBooted(): void
{
FilamentAsset::register(
$this->getAssets(),
$this->getAssetPackageName(),
);
}
protected function getAssets(): array
{
return [
AlpineComponent::make('gpt-trix-editor', __DIR__ . '/../dist/components/gpt-trix-editor.js'),
];
}
protected function getAssetPackageName(): string
{
return 'askerakbar/gpt-trix-editor';
}
}