mirror of
https://github.com/filamentphp/plugin-skeleton.git
synced 2025-12-06 13:38:53 +08:00
wip 3.x updates
This commit is contained in:
35
.gitattributes
vendored
35
.gitattributes
vendored
@@ -2,18 +2,25 @@
|
||||
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
|
||||
|
||||
# Ignore all test and documentation with "export-ignore".
|
||||
/.github export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/art export-ignore
|
||||
/docs export-ignore
|
||||
/tests export-ignore
|
||||
/.editorconfig export-ignore
|
||||
/.php_cs.dist.php export-ignore
|
||||
/psalm.xml export-ignore
|
||||
/psalm.xml.dist export-ignore
|
||||
/testbench.yaml export-ignore
|
||||
/UPGRADING.md export-ignore
|
||||
/phpstan.neon.dist export-ignore
|
||||
/.github export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.idea export-ignore
|
||||
/.prettierrc export-ignore
|
||||
/.package-lock.json export-ignore
|
||||
/.editorconfig export-ignore
|
||||
/.php_cs.dist.php export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/art export-ignore
|
||||
/docs export-ignore
|
||||
/tests export-ignore
|
||||
/psalm.xml export-ignore
|
||||
/psalm.xml.dist export-ignore
|
||||
/testbench.yaml export-ignore
|
||||
/UPGRADING.md export-ignore
|
||||
/phpstan.neon.dist export-ignore
|
||||
/phpstan-baseline.neon export-ignore
|
||||
/images export-ignore
|
||||
/package.json export-ignore
|
||||
/postcss.config.js export-ignore
|
||||
/tailwind.config.js export-ignore
|
||||
|
||||
12
.github/workflows/run-tests.yml
vendored
12
.github/workflows/run-tests.yml
vendored
@@ -2,9 +2,7 @@ name: Run Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -13,10 +11,12 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
php: [8.1]
|
||||
laravel: [9.*]
|
||||
stability: [prefer-lowest, prefer-stable]
|
||||
php: [8.2, 8.1]
|
||||
laravel: [10.*, 9.*]
|
||||
stability: [prefer-stable]
|
||||
include:
|
||||
- laravel: 10.*
|
||||
testbench: 8.*
|
||||
- laravel: 9.*
|
||||
testbench: 7.*
|
||||
|
||||
@@ -44,4 +44,4 @@ jobs:
|
||||
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/pest
|
||||
run: ./vendor/bin/pest --verbose
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
.idea
|
||||
.phpunit.result.cache
|
||||
.DS_Store
|
||||
build
|
||||
composer.lock
|
||||
coverage
|
||||
|
||||
50
bin/build.js
Normal file
50
bin/build.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import * as esbuild from 'esbuild'
|
||||
|
||||
const isDev = process.argv.includes('--dev')
|
||||
|
||||
async function compile(options) {
|
||||
const context = await esbuild.context(options)
|
||||
|
||||
if (isDev) {
|
||||
await context.watch()
|
||||
} else {
|
||||
await context.rebuild()
|
||||
await context.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
const defaultOptions = {
|
||||
define: {
|
||||
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`,
|
||||
},
|
||||
bundle: true,
|
||||
mainFields: ['module', 'main'],
|
||||
platform: 'neutral',
|
||||
sourcemap: isDev ? 'inline' : false,
|
||||
sourcesContent: isDev,
|
||||
treeShaking: true,
|
||||
target: ['es2020'],
|
||||
minify: !isDev,
|
||||
plugins: [{
|
||||
name: 'watchPlugin',
|
||||
setup: function (build) {
|
||||
build.onStart(() => {
|
||||
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
|
||||
})
|
||||
|
||||
build.onEnd((result) => {
|
||||
if (result.errors.length > 0) {
|
||||
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors)
|
||||
} else {
|
||||
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}],
|
||||
}
|
||||
|
||||
compile({
|
||||
...defaultOptions,
|
||||
entryPoints: ['./resources/js/skeleton.js'],
|
||||
outfile: './resources/dist/skeleton.js',
|
||||
})
|
||||
@@ -24,22 +24,21 @@
|
||||
"filament/filament": "^3.0",
|
||||
"filament/forms": "^3.0",
|
||||
"filament/tables": "^3.0",
|
||||
"spatie/laravel-package-tools": "^1.13.5",
|
||||
"spatie/laravel-package-tools": "^1.15.0",
|
||||
"illuminate/contracts": "^9.0|^10.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "^1.0",
|
||||
"nunomaduro/collision": "^6.0",
|
||||
"nunomaduro/collision": "^6.0|^7.0",
|
||||
"nunomaduro/larastan": "^2.0.1",
|
||||
"orchestra/testbench": "^7.0",
|
||||
"pestphp/pest": "^1.21",
|
||||
"pestphp/pest-plugin-laravel": "^1.1",
|
||||
"pestphp/pest-plugin-livewire": "^1.0",
|
||||
"pestphp/pest-plugin-parallel": "^0.3",
|
||||
"pestphp/pest": "^2.0",
|
||||
"pestphp/pest-plugin-laravel": "^2.0",
|
||||
"pestphp/pest-plugin-livewire": "^2.0",
|
||||
"phpstan/extension-installer": "^1.1",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||
"phpstan/phpstan-phpunit": "^1.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"phpunit/phpunit": "^9.5|^10.0",
|
||||
"spatie/laravel-ray": "^1.26"
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev:styles": "npx tailwindcss -i resources/css/plugin.css -o resources/dist/skeleton.css --postcss --watch",
|
||||
"dev:scripts": "esbuild resources/js/plugin.js --bundle --sourcemap=inline --outfile=resources/dist/skeleton.js --watch",
|
||||
"build:styles": "npx tailwindcss -i resources/css/plugin.css -o resources/dist/skeleton.css --postcss --minify && npm run purge",
|
||||
"build:scripts": "esbuild resources/js/plugin.js --bundle --minify --outfile=resources/dist/skeleton.js",
|
||||
"purge": "filament-purge -i resources/dist/skeleton.css -o resources/dist/skeleton.css",
|
||||
"dev": "npm-run-all --parallel dev:*",
|
||||
"build": "npm-run-all build:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@awcodes/filament-plugin-purge": "^1.0.2",
|
||||
"autoprefixer": "^10.4.7",
|
||||
"esbuild": "^0.8.57",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-import": "^15.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-tailwindcss": "^0.1.13",
|
||||
"tailwindcss": "^3.2"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
@tailwind utilities;
|
||||
@@ -1,9 +0,0 @@
|
||||
const preset = require('./vendor/filament/filament/tailwind.config.preset')
|
||||
|
||||
module.exports = {
|
||||
presets: [preset],
|
||||
content: ['./resources/**/*.{blade.php,js}'],
|
||||
corePlugins: {
|
||||
preflight: false,
|
||||
},
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npx tailwindcss -i resources/css/plugin.css -o resources/dist/skeleton.css --postcss --watch",
|
||||
"build": "npx tailwindcss -i resources/css/plugin.css -o resources/dist/skeleton.css --postcss --minify"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.7",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-import": "^15.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-tailwindcss": "^0.1.13",
|
||||
"tailwindcss": "^3.2"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
@import "../../vendor/filament/filament/resources/css/index.css";
|
||||
@@ -32,7 +32,7 @@ $description = ask('Package description');
|
||||
$usePhpStan = confirm('Enable PhpStan?', true);
|
||||
$usePint = confirm('Enable Pint?', true);
|
||||
$useDependabot = confirm('Enable Dependabot?', true);
|
||||
$useLaravelRay = confirm('Use Ray for debugging?', true);
|
||||
$useLaravelRay = confirm('Enable Ray?', true);
|
||||
$useUpdateChangelogWorkflow = confirm('Use automatic changelog updater workflow?', true);
|
||||
|
||||
$isTheme = confirm('Is this a custom theme?');
|
||||
@@ -51,7 +51,7 @@ writeln("\e[1;37mPackages & Utilities\e[0m");
|
||||
writeln('Larastan/PhpStan : '.($usePhpStan ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
writeln('Pint : '.($usePint ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
writeln('Use Dependabot : '.($useDependabot ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
writeln('Use Ray App : '.($useLaravelRay ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
writeln('Use Ray : '.($useLaravelRay ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
writeln('Auto-Changelog : '.($useUpdateChangelogWorkflow ? "\e[0;32mYes" : "\e[0;31mNo")."\e[0m");
|
||||
if ($formsOnly) {
|
||||
writeln("Filament/Forms : \e[0;32mYes\e[0m");
|
||||
@@ -71,6 +71,7 @@ if (! confirm('Modify files?', true)) {
|
||||
|
||||
if ($formsOnly) {
|
||||
safeUnlink(__DIR__.'/src/SkeletonTheme.php');
|
||||
safeUnlink(__DIR__.'/src/SkeletonPlugin.php');
|
||||
|
||||
remove_composer_filament_deps([
|
||||
'filament/filament',
|
||||
@@ -78,6 +79,7 @@ if ($formsOnly) {
|
||||
]);
|
||||
} elseif ($tablesOnly) {
|
||||
safeUnlink(__DIR__.'/src/SkeletonTheme.php');
|
||||
safeUnlink(__DIR__.'/src/SkeletonPlugin.php');
|
||||
|
||||
remove_composer_filament_deps([
|
||||
'filament/filament',
|
||||
@@ -86,6 +88,7 @@ if ($formsOnly) {
|
||||
} else {
|
||||
if ($isTheme) {
|
||||
safeUnlink(__DIR__.'/src/SkeletonServiceProvider.php');
|
||||
safeUnlink(__DIR__.'/src/SkeletonPlugin.php');
|
||||
safeUnlink(__DIR__.'/src/Skeleton.php');
|
||||
removeDirectory(__DIR__.'/config');
|
||||
removeDirectory(__DIR__.'/database');
|
||||
@@ -106,16 +109,6 @@ if ($formsOnly) {
|
||||
]);
|
||||
}
|
||||
|
||||
if ($isTheme) {
|
||||
copy(__DIR__.'/configure-stubs/theme/package.json', __DIR__.'/package.json');
|
||||
copy(__DIR__.'/configure-stubs/theme/plugin.css', __DIR__.'/resources/css/plugin.css');
|
||||
copy(__DIR__.'/configure-stubs/theme/tailwind.config.js', __DIR__.'/tailwind.config.js');
|
||||
} else {
|
||||
copy(__DIR__.'/configure-stubs/package/package.json', __DIR__.'/package.json');
|
||||
copy(__DIR__.'/configure-stubs/package/plugin.css', __DIR__.'/resources/css/plugin.css');
|
||||
copy(__DIR__.'/configure-stubs/package/tailwind.config.js', __DIR__.'/tailwind.config.js');
|
||||
}
|
||||
|
||||
$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes());
|
||||
|
||||
foreach ($files as $file) {
|
||||
@@ -138,6 +131,7 @@ foreach ($files as $file) {
|
||||
str_contains($file, determineSeparator('src/Skeleton.php')) => rename($file, determineSeparator('./src/'.$className.'.php')),
|
||||
str_contains($file, determineSeparator('src/SkeletonServiceProvider.php')) => rename($file, determineSeparator('./src/'.$className.'ServiceProvider.php')),
|
||||
str_contains($file, determineSeparator('src/SkeletonTheme.php')) => rename($file, determineSeparator('./src/'.$className.'Theme.php')),
|
||||
str_contains($file, determineSeparator('src/SkeletonPlugin.php')) => rename($file, determineSeparator('./src/'.$className.'Plugin.php')),
|
||||
str_contains($file, determineSeparator('src/Facades/Skeleton.php')) => rename($file, determineSeparator('./src/Facades/'.$className.'.php')),
|
||||
str_contains($file, determineSeparator('src/Commands/SkeletonCommand.php')) => rename($file, determineSeparator('./src/Commands/'.$className.'Command.php')),
|
||||
str_contains($file, determineSeparator('src/Testing/TestsSkeleton.php')) => rename($file, determineSeparator('./src/Testing/Tests'.$className.'.php')),
|
||||
@@ -177,6 +171,7 @@ if (! $usePhpStan) {
|
||||
|
||||
if (! $usePint) {
|
||||
safeUnlink(__DIR__.'/.github/workflows/fix-php-code-style-issues.yml');
|
||||
safeUnlink(__DIR__.'/pint.json');
|
||||
|
||||
remove_composer_deps([
|
||||
'laravel/pint',
|
||||
@@ -192,7 +187,6 @@ if (! $useUpdateChangelogWorkflow) {
|
||||
confirm('Execute `composer install` and run tests?') && run('composer install && composer test');
|
||||
|
||||
if (confirm('Let this script delete itself?', true)) {
|
||||
removeDirectory(__DIR__.'/configure-stubs');
|
||||
unlink(__FILE__);
|
||||
}
|
||||
|
||||
|
||||
13
package-theme.json
Normal file
13
package-theme.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npx tailwindcss -i resources/css/skeleton.css -o resources/dist/skeleton.css --postcss --watch",
|
||||
"build": "npx tailwindcss -i resources/css/skeleton.css -o resources/dist/skeleton.css --postcss --minify"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.7",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-import": "^15.0.0",
|
||||
"tailwindcss": "^3.3.2"
|
||||
}
|
||||
}
|
||||
23
package.json
Normal file
23
package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev:styles": "npx tailwindcss -i resources/css/skeleton.css -o resources/dist/skeleton.css --postcss --watch",
|
||||
"dev:scripts": "node bin/build.js --dev",
|
||||
"build:styles": "npx tailwindcss -i resources/css/skeleton.css -o resources/dist/skeleton.css --postcss --minify && npm run purge",
|
||||
"build:scripts": "node bin/build.js",
|
||||
"purge": "filament-purge -i resources/dist/skeleton.css -o resources/dist/skeleton.css -v 3.x",
|
||||
"dev": "npm-run-all --parallel dev:*",
|
||||
"build": "npm-run-all build:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@awcodes/filament-plugin-purge": "^1.1.1",
|
||||
"autoprefixer": "^10.4.7",
|
||||
"esbuild": "^0.17.19",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-import": "^15.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-tailwindcss": "^0.1.13",
|
||||
"tailwindcss": "^3.3.2"
|
||||
}
|
||||
}
|
||||
14
pint.json
Normal file
14
pint.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"preset": "laravel",
|
||||
"rules": {
|
||||
"blank_line_before_statement": true,
|
||||
"concat_space": {
|
||||
"spacing": "one"
|
||||
},
|
||||
"method_argument_space": true,
|
||||
"single_trait_insert_per_statement": true,
|
||||
"types_spaces": {
|
||||
"space": "single"
|
||||
}
|
||||
}
|
||||
}
|
||||
5
resources/css/skeleton.css
vendored
Normal file
5
resources/css/skeleton.css
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@import '../../vendor/filament/forms/dist/index.css';
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
5
resources/lang/en/skeleton.php
Normal file
5
resources/lang/en/skeleton.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
//
|
||||
];
|
||||
@@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*/
|
||||
class Skeleton extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
protected static function getFacadeAccessor(): string
|
||||
{
|
||||
return \VendorName\Skeleton\Skeleton::class;
|
||||
}
|
||||
|
||||
36
src/SkeletonPlugin.php
Normal file
36
src/SkeletonPlugin.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace VendorName\Skeleton;
|
||||
|
||||
use Filament\Contracts\Plugin;
|
||||
use Filament\Panel;
|
||||
|
||||
class SkeletonPlugin implements Plugin
|
||||
{
|
||||
protected static string $name = 'skeleton-plugin';
|
||||
|
||||
public function getId(): string
|
||||
{
|
||||
return static::$name;
|
||||
}
|
||||
|
||||
public function register(Panel $panel): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot(Panel $panel): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public static function make(): static
|
||||
{
|
||||
return app(static::class);
|
||||
}
|
||||
|
||||
public static function get(): static
|
||||
{
|
||||
return filament(app(static::class)->getId());
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace VendorName\Skeleton;
|
||||
|
||||
use Filament\Context;
|
||||
use Filament\Panel;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Support\Assets\AlpineComponent;
|
||||
use Filament\Support\Assets\Asset;
|
||||
@@ -58,52 +58,50 @@ class SkeletonServiceProvider extends PackageServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
public function packageRegistered(): void
|
||||
public function register(): void
|
||||
{
|
||||
// Facade Registration
|
||||
$this->app->bind('skeleton', function (): Skeleton {
|
||||
parent::register();
|
||||
|
||||
// Facade Registration
|
||||
app()->bind('skeleton', function (): Skeleton {
|
||||
return new Skeleton();
|
||||
});
|
||||
|
||||
// Context Registration
|
||||
$this->app->resolving('skeleton', function () {
|
||||
foreach ($this->getContexts() as $context) {
|
||||
Filament::registerContext($context);
|
||||
}
|
||||
});
|
||||
|
||||
// Asset Registration
|
||||
$this->app->resolving(AssetManager::class, function () {
|
||||
FilamentAsset::register($this->getAssets(), $this->getAssetPackage());
|
||||
FilamentAsset::registerScriptData($this->getScriptData(), $this->getAssetPackage());
|
||||
});
|
||||
|
||||
// Icon Registration
|
||||
$this->app->resolving(IconManager::class, function () {
|
||||
FilamentIcon::register($this->getIcons());
|
||||
});
|
||||
}
|
||||
|
||||
public function packageBooted(): void
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerMacros();
|
||||
parent::boot();
|
||||
|
||||
// Handle Stubs
|
||||
if ($this->app->runningInConsole()) {
|
||||
// Asset Registration
|
||||
FilamentAsset::register(
|
||||
$this->getAssets(),
|
||||
$this->getAssetPackage()
|
||||
);
|
||||
|
||||
FilamentAsset::registerScriptData(
|
||||
$this->getScriptData(),
|
||||
$this->getAssetPackage()
|
||||
);
|
||||
|
||||
// Icon Registration
|
||||
FilamentIcon::register($this->getIcons());
|
||||
|
||||
// Handle Stubs
|
||||
if (app()->runningInConsole()) {
|
||||
foreach (app(Filesystem::class)->files(__DIR__.'/../stubs/') as $file) {
|
||||
$this->publishes([
|
||||
$file->getRealPath() => base_path("stubs/skeleton/{$file->getFilename()}"),
|
||||
], 'forms-stubs');
|
||||
], 'skeleton-stubs');
|
||||
}
|
||||
}
|
||||
|
||||
// Testing
|
||||
// Testing
|
||||
TestableLivewire::mixin(new TestsSkeleton());
|
||||
}
|
||||
|
||||
protected function getAssetPackage(): ?string
|
||||
{
|
||||
return static::$name ?? null;
|
||||
return ':vendor_slug/:package_slug';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +110,7 @@ class SkeletonServiceProvider extends PackageServiceProvider
|
||||
protected function getAssets(): array
|
||||
{
|
||||
return [
|
||||
// AlpineComponent::make('skeleton', __DIR__ . '/../resources/dist/components/skeleton.js'),
|
||||
// AlpineComponent::make('skeleton', __DIR__ . '/../resources/dist/components/skeleton.js'),
|
||||
Css::make('skeleton-styles', __DIR__.'/../resources/dist/skeleton.js'),
|
||||
Js::make('skeleton-scripts', __DIR__.'/../resources/dist/skeleton.js'),
|
||||
];
|
||||
@@ -128,14 +126,6 @@ class SkeletonServiceProvider extends PackageServiceProvider
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Context>
|
||||
*/
|
||||
protected function getContexts(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, Icon>
|
||||
*/
|
||||
@@ -169,8 +159,4 @@ class SkeletonServiceProvider extends PackageServiceProvider
|
||||
'create_skeleton_table',
|
||||
];
|
||||
}
|
||||
|
||||
protected function registerMacros(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace VendorName;
|
||||
|
||||
use Filament\Context;
|
||||
use Filament\Panel;
|
||||
use Filament\Contracts\Plugin;
|
||||
use Filament\Support\Assets\Theme;
|
||||
use Filament\Support\Color;
|
||||
@@ -15,26 +15,24 @@ class Skeleton implements Plugin
|
||||
return 'skeleton-theme';
|
||||
}
|
||||
|
||||
public function register(Context $context): void
|
||||
public function register(Panel $panel): void
|
||||
{
|
||||
FilamentAsset::register([
|
||||
Theme::make('skeleton', __DIR__.'/../resources/dist/skeleton.css'),
|
||||
]);
|
||||
|
||||
$context
|
||||
$panel
|
||||
->font('DM Sans')
|
||||
->primaryColor(Color::Amber)
|
||||
->secondaryColor(Color::Gray)
|
||||
->warningColor(Color::Amber)
|
||||
->dangerColor(Color::Rose)
|
||||
->successColor(Color::Green)
|
||||
->grayColor(Color::Slate)
|
||||
->sidebarWidth('20rem')
|
||||
->collapsedSidebarWidth('5.4rem')
|
||||
->grayColor(Color::Gray)
|
||||
->theme('skeleton');
|
||||
}
|
||||
|
||||
public function boot(Context $context): void
|
||||
public function boot(Panel $panel): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ const preset = require('./vendor/filament/filament/tailwind.config.preset')
|
||||
module.exports = {
|
||||
presets: [preset],
|
||||
content: [
|
||||
'./vendor/filament/**/*.blade.php'
|
||||
'./app/Filament/**/*.php',
|
||||
'./resources/views/filament/**/*.blade.php',
|
||||
'./vendor/filament/**/*.blade.php',
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user