Skip to content

Commit c264589

Browse files
committed
updates for Filament v4
1 parent 93d46d1 commit c264589

18 files changed

+110
-84
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
uses: aglipanci/[email protected]
2323

2424
- name: Commit changes
25-
uses: stefanzweifel/git-auto-commit-action@v5
25+
uses: stefanzweifel/git-auto-commit-action@v6
2626
with:
2727
commit_message: Fix styling

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.1'
19+
php-version: '8.2'
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: run-tests
1+
name: "Run Tests"
22

33
on:
44
push:
@@ -13,19 +13,18 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.3, 8.2, 8.1]
17-
laravel: [11.*, 10.*]
16+
php: [8.4, 8.3, 8.2]
17+
laravel: [12.*, 11.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20-
- laravel: 10.*
21-
testbench: 8.*
22-
carbon: 2.*
20+
- laravel: 12.*
21+
testbench: 10.*
22+
carbon: 3.*
23+
collision: 8.*
2324
- laravel: 11.*
2425
testbench: 9.*
2526
carbon: 3.*
26-
exclude:
27-
- laravel: 11.*
28-
php: 8.1
27+
collision: 8.*
2928

3029
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3130

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.DS_Store
1+
**/.DS_Store
22
.idea
33
.phpunit.result.cache
4+
.phpunit.cache
45
.vscode
56
build
67
composer.lock

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ You can install the package via composer:
2525
composer require :vendor_slug/:package_slug
2626
```
2727

28+
> [!IMPORTANT]
29+
> If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme) first.
30+
31+
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
32+
33+
```css
34+
@source '../../../../vendor/:vendor_slug/:package_slug/resources/**/*.blade.php';
35+
```
36+
2837
You can publish and run the migrations with:
2938

3039
```bash

bin/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ compile({
4747
...defaultOptions,
4848
entryPoints: ['./resources/js/index.js'],
4949
outfile: './resources/dist/skeleton.js',
50+
}).then(() => {
51+
console.log(`Build completed for skeleton.js`)
5052
})

composer.json

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^8.1",
25-
"filament/filament": "^3.0",
26-
"filament/forms": "^3.0",
27-
"filament/tables": "^3.0",
24+
"php": "^8.2",
25+
"filament/filament": "^4.0",
26+
"filament/forms": "^4.0",
27+
"filament/tables": "^4.0",
2828
"spatie/laravel-package-tools": "^1.15.0"
2929
},
3030
"require-dev": {
31-
"larastan/larastan": "^2.0",
31+
"larastan/larastan": "^3.0",
3232
"laravel/pint": "^1.0",
33-
"nunomaduro/collision": "^7.9|^8.0",
34-
"orchestra/testbench": "^8.0|^9.0",
35-
"pestphp/pest": "^2.1",
36-
"pestphp/pest-plugin-arch": "^2.0",
37-
"pestphp/pest-plugin-laravel": "^2.0",
33+
"nunomaduro/collision": "^8.0",
34+
"orchestra/testbench": "^9.0|^10.0",
35+
"pestphp/pest": "^3.0",
36+
"pestphp/pest-plugin-arch": "^3.0",
37+
"pestphp/pest-plugin-laravel": "^3.0",
38+
"pestphp/pest-plugin-livewire": "^3.0",
3839
"phpstan/extension-installer": "^1.1",
39-
"phpstan/phpstan-deprecation-rules": "^1.0",
40-
"phpstan/phpstan-phpunit": "^1.0",
40+
"phpstan/phpstan-deprecation-rules": "^2.0",
41+
"phpstan/phpstan-phpunit": "^2.0",
42+
"rector/rector": "^2.0",
4143
"spatie/laravel-ray": "^1.26"
4244
},
4345
"autoload": {
@@ -53,17 +55,12 @@
5355
},
5456
"scripts": {
5557
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
56-
"analyse": "vendor/bin/phpstan analyse",
57-
"test": "vendor/bin/pest",
58-
"test-coverage": "vendor/bin/pest --coverage",
59-
"format": "vendor/bin/pint"
60-
},
61-
"config": {
62-
"sort-packages": true,
63-
"allow-plugins": {
64-
"pestphp/pest-plugin": true,
65-
"phpstan/extension-installer": true
66-
}
58+
"analyse": "phpstan analyse",
59+
"lint": "pint",
60+
"refactor": "rector",
61+
"test": "pest",
62+
"test:lint": "pint --test",
63+
"test:refactor": "rector --dry-run"
6764
},
6865
"extra": {
6966
"laravel": {
@@ -75,6 +72,14 @@
7572
}
7673
}
7774
},
75+
"config": {
76+
"sort-packages": true,
77+
"allow-plugins": {
78+
"composer/package-versions-deprecated": true,
79+
"pestphp/pest-plugin": true,
80+
"phpstan/extension-installer": true
81+
}
82+
},
7883
"minimum-stability": "dev",
7984
"prefer-stable": true
8085
}

configure.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
$usePint = confirm('Enable Pint?', true);
3636
$useDependabot = confirm('Enable Dependabot?', true);
3737
$useLaravelRay = confirm('Enable Ray?', true);
38+
$useRector = confirm('Enable Rector?', true);
3839
$useUpdateChangelogWorkflow = confirm('Use automatic changelog updater workflow?', true);
3940

4041
$isTheme = confirm('Is this a custom theme?');
@@ -54,6 +55,7 @@
5455
writeln('Pint : ' . ($usePint ? "\e[0;32mYes" : "\e[0;31mNo") . "\e[0m");
5556
writeln('Use Dependabot : ' . ($useDependabot ? "\e[0;32mYes" : "\e[0;31mNo") . "\e[0m");
5657
writeln('Use Ray : ' . ($useLaravelRay ? "\e[0;32mYes" : "\e[0;31mNo") . "\e[0m");
58+
writeln('Use Rector : ' . ($useRector ? "\e[0;32mYes" : "\e[0;31mNo") . "\e[0m");
5759
writeln('Auto-Changelog : ' . ($useUpdateChangelogWorkflow ? "\e[0;32mYes" : "\e[0;31mNo") . "\e[0m");
5860
if ($formsOnly) {
5961
writeln("Filament/Forms : \e[0;32mYes\e[0m");
@@ -169,7 +171,7 @@
169171
'phpstan/extension-installer',
170172
'phpstan/phpstan-deprecation-rules',
171173
'phpstan/phpstan-phpunit',
172-
'nunomaduro/larastan',
174+
'larastan/larastan',
173175
], 'require-dev');
174176

175177
removeComposerDeps(['analyse'], 'scripts');
@@ -186,8 +188,19 @@
186188
removeComposerDeps(['format'], 'scripts');
187189
}
188190

191+
if (! $useRector) {
192+
safeUnlink(__DIR__ . '/rector.php');
193+
194+
removeComposerDeps([
195+
'rector/rector',
196+
], 'require-dev');
197+
198+
removeComposerDeps(['refactor', 'test:refactor', ], 'scripts');
199+
}
200+
189201
if (! $useUpdateChangelogWorkflow) {
190202
safeUnlink(__DIR__ . '/.github/workflows/update-changelog.yml');
203+
safeUnlink(__DIR__ . '/CHANGELOG.md');
191204
}
192205

193206
confirm('Execute `composer install`?') && run('composer install');

database/migrations/create_skeleton_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Schema;
66

77
return new class extends Migration
88
{
9-
public function up()
9+
public function up(): void
1010
{
1111
Schema::create('migration_table_name_table', function (Blueprint $table) {
1212
$table->id();

package.json

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,11 @@
22
"private": true,
33
"type": "module",
44
"scripts": {
5-
"dev:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/skeleton.css --postcss --watch",
6-
"dev:scripts": "node bin/build.js --dev",
7-
"build:styles": "npx tailwindcss -i resources/css/index.css -o resources/dist/skeleton.css --postcss --minify && npm run purge",
8-
"build:scripts": "node bin/build.js",
9-
"purge": "filament-purge -i resources/dist/skeleton.css -o resources/dist/skeleton.css -v 3.x",
10-
"dev": "npm-run-all --parallel dev:*",
11-
"build": "npm-run-all build:*"
5+
"dev": "node bin/build.js --dev",
6+
"build": "node bin/build.js"
127
},
138
"devDependencies": {
14-
"@awcodes/filament-plugin-purge": "^1.1.1",
15-
"@tailwindcss/forms": "^0.5.4",
16-
"@tailwindcss/typography": "^0.5.9",
17-
"autoprefixer": "^10.4.14",
18-
"esbuild": "^0.19.2",
19-
"npm-run-all": "^4.1.5",
20-
"postcss": "^8.4.26",
21-
"postcss-import": "^15.1.0",
22-
"prettier": "^2.7.1",
23-
"prettier-plugin-tailwindcss": "^0.1.13",
24-
"tailwindcss": "^3.3.3"
9+
"esbuild": "^0.25.5",
10+
"prettier": "^3.5.3"
2511
}
2612
}

0 commit comments

Comments
 (0)