Skip to content

Commit dd86b0b

Browse files
authored
Merge pull request #16 from pxlrbt/feature/filament-v4
Upgrade to Filament v4
2 parents f8ccc41 + 0695ca1 commit dd86b0b

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"require": {
1717
"php": "^8.0",
18-
"filament/filament": "^3.0-stable"
18+
"filament/filament": "^3.0|^4.0"
1919
},
2020
"require-dev": {
2121
"laravel/pint": "^1.10"

readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ Never confuse your tabs with different Filament environments again.
1515
## Installation via Composer
1616

1717
| Plugin Version | Filament Version | PHP Version |
18-
|----------------|-----------------|-------------|
19-
| 1.x | ^2.9.15 | \> 8.0 |
20-
| 2.x | 3.x | \> 8.1 |
18+
|----------------|------------------|-------------|
19+
| 1.x | ^2.9.15 | \> 8.0 |
20+
| 2.x | 3.x | \> 8.1 |
21+
| 3.x | 4.x | \> 8.1 |
2122

2223
```bash
2324
composer require pxlrbt/filament-environment-indicator

resources/css/styles.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.environment-indicator {
2+
display: none;
3+
height: 2.25rem;
4+
5+
@media (width > 40rem) {
6+
display: flex;
7+
}
8+
9+
code {
10+
margin-block-start: 1px;
11+
margin-inline-start: 0.25rem;
12+
font-size: var(--text-xs);
13+
}
14+
}

resources/views/badge.blade.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
@php use Filament\Facades\Filament; @endphp
12
<div
23
class="
3-
environment-indicator hidden sm:flex items-center h-9 px-3 text-sm font-medium
4-
rounded-lg shadow-sm ring-1
5-
ring-custom-600/20 bg-custom-50 text-custom-600
6-
dark:ring-custom-400/30 dark:bg-custom-400/10 dark:text-custom-400
4+
environment-indicator
5+
fi-badge fi-color fi-text-color-600
6+
dark:fi-text-color-400
77
"
88
style="
9-
--c-50: {{ $color[50] }};
10-
--c-300: {{ $color[300] }};
11-
--c-400: {{ $color[400] }};
12-
--c-600: {{ $color[600] }};
9+
--color-50: {{ $color[50] }};
10+
--color-300: {{ $color[300] }};
11+
--color-400: {{ $color[400] }};
12+
--color-600: {{ $color[600] }};
1313
"
1414
>
1515
{{ $environment }}
1616

1717
@isset($branch)
18-
<code class="text-xs ml-1" style="margin-top: 1px">({{ $branch }})</code>
18+
<code>({{ $branch }})</code>
1919
@endisset
2020
</div>

src/FilamentEnvironmentIndicatorServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace pxlrbt\FilamentEnvironmentIndicator;
44

5+
use Filament\Support\Assets\Css;
6+
use Filament\Support\Facades\FilamentAsset;
57
use Spatie\LaravelPackageTools\Package;
68
use Spatie\LaravelPackageTools\PackageServiceProvider;
79

@@ -11,6 +13,10 @@ class FilamentEnvironmentIndicatorServiceProvider extends PackageServiceProvider
1113

1214
public function configurePackage(Package $package): void
1315
{
16+
FilamentAsset::register([
17+
Css::make('styles', __DIR__.'/../resources/css/styles.css'),
18+
], static::$name);
19+
1420
$package
1521
->name(static::$name)
1622
->hasViews();

0 commit comments

Comments
 (0)