Skip to content

Commit 715af4b

Browse files
committed
working updates for filament v4
1 parent 174b111 commit 715af4b

32 files changed

+1132
-83
lines changed

.github/workflows/fix-php-code-styling.yml renamed to .github/workflows/lint.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
name: "Fix PHP code styling"
1+
name: 'Fix PHP Code Styling'
22

33
on:
4+
workflow_dispatch:
45
pull_request:
5-
branches:
6-
- 2.x
76
types:
87
- closed
8+
branches:
9+
- 3.x
910
paths:
1011
- '**.php'
1112

@@ -23,9 +24,10 @@ jobs:
2324
ref: ${{ github.head_ref }}
2425

2526
- name: Fix PHP code style issues
26-
uses: aglipanci/laravel-pint-action@2.5
27+
uses: aglipanci/laravel-pint-action@v2
2728

2829
- name: Commit changes
2930
uses: stefanzweifel/git-auto-commit-action@v5
3031
with:
31-
commit_message: "Chore: Fix PHP code styling"
32+
commit_message: "Format Code"
33+
commit_user_name: 'GitHub Actions'

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "Tests"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
branches:
10+
- 3.x
11+
paths:
12+
- '**.php'
13+
- '.github/workflows/tests.yml'
14+
- 'phpunit.xml.dist'
15+
- 'composer.json'
16+
- 'composer.lock'
17+
18+
jobs:
19+
test:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
os: [ubuntu-latest]
25+
php: [8.3, 8.2]
26+
laravel: [12.*, 11.*]
27+
stability: [prefer-stable]
28+
include:
29+
- laravel: 12.*
30+
testbench: 10.*
31+
carbon: 3.*
32+
collision: 8.*
33+
- laravel: 11.*
34+
testbench: 9.*
35+
carbon: 3.*
36+
collision: 8.*
37+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
38+
steps:
39+
- name: Checkout Code
40+
uses: actions/checkout@v4
41+
42+
- name: Cache Dependencies
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/.composer/cache/files
46+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: ${{ matrix.php }}
52+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
53+
coverage: none
54+
55+
- name: Install Dependencies
56+
run: |
57+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
58+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
59+
60+
- name: Install Dependencies
61+
run: |
62+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" "nunomaduro/collision:${{ matrix.collision }}" --no-interaction --no-update
63+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
64+
65+
- name: Execute tests
66+
run: vendor/bin/pest --parallel

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
**/.DS_Store
12
.idea
3+
.php_cs
4+
.php_cs.cache
5+
.php-cs-fixer.cache
26
.phpunit.result.cache
7+
.phpunit.cache
8+
.vscode
39
build
410
composer.lock
511
coverage
612
docs
13+
node_modules
714
phpunit.xml
815
phpstan.neon
916
testbench.yaml
1017
vendor
11-
node_modules
12-
.DS_Store

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# Overlook for Filament
2-
1+
![overlook-og](https://res.cloudinary.com/aw-codes/image/upload/w_1200,f_auto,q_auto/plugins/overlook/awcodes-overlook.jpg)
32
[![Latest Version on Packagist](https://img.shields.io/packagist/v/awcodes/overlook.svg?style=flat-square)](https://packagist.org/packages/awcodes/overlook)
43
[![Total Downloads](https://img.shields.io/packagist/dt/awcodes/overlook.svg?style=flat-square)](https://packagist.org/packages/awcodes/overlook)
54

6-
![overlook-og](https://res.cloudinary.com/aw-codes/image/upload/w_1200,f_auto,q_auto/plugins/overlook/awcodes-overlook.jpg)
5+
# Overlook for Filament
76

87
A Filament plugin that adds an app overview widget to your admin panel.
98

10-
<!-- docs_start -->
9+
## Compatibility
10+
11+
| Package Version | Filament Version |
12+
|-----------------|------------------|
13+
| 1.x | 2.x |
14+
| 2.x | 3.x |
15+
| 3.x | 4.x |
1116

1217
## Installation
1318

@@ -17,17 +22,13 @@ You can install the package via composer:
1722
composer require awcodes/overlook
1823
```
1924

20-
In an effort to align with Filament's theming methodology you will need to use a custom theme to use this plugin.
21-
22-
> **Note**
23-
> If you have not set up a custom theme and are using a Panel follow the instructions in the [Filament Docs](https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme) first.
25+
> [!IMPORTANT]
26+
> 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.
2427
25-
Add the plugin's views to your `tailwind.config.js` file.
28+
After setting up a custom theme add the plugin's views to your theme css file.
2629

27-
```js
28-
content: [
29-
'<path-to-vendor>/awcodes/overlook/resources/**/*.blade.php',
30-
]
30+
```css
31+
@source '../../../../vendor/awcodes/outlook/resources/**/*.blade.php';
3132
```
3233

3334
## Usage
@@ -206,9 +207,6 @@ public function panel(Panel $panel): Panel
206207
}
207208
```
208209

209-
210-
<!-- docs_end -->
211-
212210
## Changelog
213211

214212
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

composer.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"keywords": [
55
"awcodes",
66
"laravel",
7-
"overlook"
7+
"filament",
8+
"overlook",
9+
"plugin"
810
],
911
"homepage": "https://github.com/awcodes/overlook",
1012
"support": {
@@ -20,22 +22,42 @@
2022
}
2123
],
2224
"require": {
23-
"php": "^8.1",
25+
"php": "^8.2",
2426
"ext-intl": "*",
25-
"filament/filament": "^3.0",
27+
"filament/filament": "^4.0",
2628
"spatie/laravel-package-tools": "^1.15"
2729
},
2830
"require-dev": {
2931
"laravel/pint": "^1.0",
32+
"orchestra/testbench": "^9.0|^10.0",
33+
"pestphp/pest": "^3.7",
34+
"pestphp/pest-plugin-laravel": "^3.0",
35+
"pestphp/pest-plugin-livewire": "^3.0",
36+
"rector/rector": "^2.0",
3037
"spatie/laravel-ray": "^1.26"
3138
},
3239
"autoload": {
3340
"psr-4": {
3441
"Awcodes\\Overlook\\": "src"
3542
}
3643
},
44+
"autoload-dev": {
45+
"psr-4": {
46+
"Awcodes\\Overlook\\Tests\\": "tests/src",
47+
"Awcodes\\Overlook\\Tests\\Database\\Factories\\": "tests/database/factories"
48+
}
49+
},
3750
"scripts": {
38-
"pint": "vendor/bin/pint"
51+
"lint": "pint",
52+
"refactor": "rector",
53+
"test:lint": "pint --test",
54+
"test:refactor": "rector --dry-run",
55+
"test:unit": "pest",
56+
"test": [
57+
"@test:refactor",
58+
"@test:lint",
59+
"@test:unit"
60+
]
3961
},
4062
"config": {
4163
"sort-packages": true,

phpunit.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Test Suite">
5+
<directory suffix=".php">./tests/</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="APP_ENV" value="self-testing"/>
10+
<env name="APP_KEY" value="base64:4bHj7CIUiEzDxa9oAS3bncF3L5czGQHhyytRB7QAbUs="/>
11+
<env name="DB_CONNECTION" value="sqlite"/>
12+
<env name="DB_DATABASE" value=":memory:"/>
13+
<env name="QUEUE_CONNECTION" value="sync"/>
14+
<env name="SESSION_DRIVER" value="array"/>
15+
</php>
16+
<source>
17+
<include>
18+
<directory suffix=".php">./src</directory>
19+
</include>
20+
</source>
21+
</phpunit>

pint.json

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
11
{
2-
"preset": "laravel",
3-
"rules": {
4-
"blank_line_before_statement": true,
5-
"concat_space": {
6-
"spacing": "one"
7-
},
8-
"method_argument_space": true,
9-
"single_trait_insert_per_statement": true,
10-
"types_spaces": {
11-
"space": "single"
2+
"preset": "laravel",
3+
"rules": {
4+
"array_push": true,
5+
"backtick_to_shell_exec": true,
6+
"date_time_immutable": true,
7+
"declare_strict_types": true,
8+
"lowercase_keywords": true,
9+
"lowercase_static_reference": true,
10+
"fully_qualified_strict_types": true,
11+
"global_namespace_import": {
12+
"import_classes": true,
13+
"import_constants": true,
14+
"import_functions": true
15+
},
16+
"mb_str_functions": true,
17+
"modernize_types_casting": true,
18+
"new_with_parentheses": false,
19+
"no_superfluous_elseif": true,
20+
"no_useless_else": true,
21+
"no_multiple_statements_per_line": true,
22+
"ordered_class_elements": {
23+
"order": [
24+
"use_trait",
25+
"case",
26+
"constant",
27+
"constant_public",
28+
"constant_protected",
29+
"constant_private",
30+
"property_public",
31+
"property_protected",
32+
"property_private",
33+
"construct",
34+
"destruct",
35+
"magic",
36+
"phpunit",
37+
"method_abstract",
38+
"method_public_static",
39+
"method_public",
40+
"method_protected_static",
41+
"method_protected",
42+
"method_private_static",
43+
"method_private"
44+
],
45+
"sort_algorithm": "none"
46+
},
47+
"ordered_interfaces": true,
48+
"ordered_traits": true,
49+
"protected_to_private": true,
50+
"self_accessor": true,
51+
"self_static_accessor": true,
52+
"strict_comparison": true,
53+
"visibility_required": true
1254
}
13-
}
14-
}
55+
}

rector.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__.'/src',
10+
])
11+
->withPreparedSets(
12+
deadCode: true,
13+
codeQuality: true,
14+
typeDeclarations: true,
15+
privatization: true,
16+
earlyReturn: true,
17+
strictBooleans: true,
18+
)
19+
->withPhpSets();

0 commit comments

Comments
 (0)