This commit is contained in:
Adam Weston
2022-12-05 00:36:03 -05:00
parent a45b10717e
commit 0ae390601a
13 changed files with 277 additions and 380 deletions

View File

@@ -2,39 +2,56 @@
namespace VendorName\Skeleton;
//use Filament\Support\Assets\Js;
//use Filament\Support\Assets\Css;
use Filament\Support\Assets\Asset;
use Filament\PluginServiceProvider;
use Spatie\LaravelPackageTools\Package;
//use Filament\Support\Assets\AlpineComponent;
use VendorName\Skeleton\Commands\SkeletonCommand;
class SkeletonServiceProvider extends PluginServiceProvider
{
public static string $name = 'skeleton';
protected array $resources = [
// CustomResource::class,
];
protected array $pages = [
// CustomPage::class,
];
protected array $widgets = [
// CustomWidget::class,
];
protected array $styles = [
'plugin-skeleton' => __DIR__.'/../resources/dist/skeleton.css',
];
protected array $scripts = [
'plugin-skeleton' => __DIR__.'/../resources/dist/skeleton.js',
];
// protected array $beforeCoreScripts = [
// 'plugin-skeleton' => __DIR__ . '/../resources/dist/skeleton.js',
// ];
public function configurePackage(Package $package): void
{
$package->name(static::$name);
$package->name(static::$name)
->hasConfigFile()
->hasViews()
->hasMigration('create_skeleton_table')
->hasCommand(SkeletonCommand::class);
}
public function packageRegistered(): void
{
parent::packageRegistered();
$this->app->bind('skeleton', function (): Skeleton {
return new Skeleton();
});
}
public function packageBooted(): void
{
parent::packageBooted();
}
protected function getAssetPackage(): ?string
{
return 'skeleton';
}
/**
* @return array<Asset>
*/
protected function getAssets(): array
{
return [
// AlpineComponent::make('skeleton', __DIR__ . '/../resources/dist/components/skeleton.js'),
// Css::make('echo', __DIR__ . '/../resources/dist/skeleton.js'),
// Js::make('echo', __DIR__ . '/../resources/dist/skeleton.js'),
];
}
}