mirror of
https://github.com/filamentphp/plugin-skeleton.git
synced 2025-12-08 06:18:52 +08:00
wip
This commit is contained in:
@@ -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'),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user