Skip to content

Commit

Permalink
fix: Removed enums to support PHP 8.0
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Frey <[email protected]>
  • Loading branch information
lukas-frey committed Oct 12, 2022
1 parent babbe3b commit 4a8bf11
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"orchestra/testbench": "^7.0"
},
"require": {
"php": "^8.1",
"php": "^8.0",
"filament/filament": "^2.0",
"illuminate/contracts": "^9.0"
},
Expand Down
2 changes: 1 addition & 1 deletion resources/views/forms/icon-picker.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div {{ $attributes->merge([
'class' => "filament-icon-picker filament-icon-picker-{$getLayout()->value}",
'class' => "filament-icon-picker filament-icon-picker-{$getLayout()}",
...$getColumnsConfig()
]) }}>
@include('forms::components.select')
Expand Down
6 changes: 3 additions & 3 deletions src/Forms/IconPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IconPicker extends Select

protected Closure|string|Htmlable|null $itemTemplate = null;

protected Layout $layout = Layout::FLOATING;
protected string $layout = Layout::FLOATING;

protected bool|Closure $show;

Expand Down Expand Up @@ -116,14 +116,14 @@ public function getDisallowedIcons(): ?array
]);
}

public function layout(Layout|Closure $layout): static
public function layout(string|Closure $layout): static
{
$this->layout = $layout;

return $this;
}

public function getLayout(): Layout
public function getLayout(): string
{
return $this->evaluate($this->layout);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Guava\FilamentIconPicker;

enum Layout: string
class Layout
{
case FLOATING = 'floating';
case ON_TOP = 'on-top';
public const FLOATING = 'floating';
public const ON_TOP = 'on_top';
}

0 comments on commit 4a8bf11

Please sign in to comment.