Skip to content

Commit

Permalink
Add Trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Nascimento committed May 22, 2024
1 parent 277d54e commit df4a240
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Enums/TypeFieldEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Joaopaulolndev\FilamentEditProfile\Enums;

use Joaopaulolndev\FilamentGeneralSettings\Traits\WithOptions;

use Joaopaulolndev\FilamentEditProfile\Traits\WithOptions;

enum TypeFieldEnum: string
{
Expand Down
13 changes: 13 additions & 0 deletions src/Traits/WithOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Joaopaulolndev\FilamentEditProfile\Traits;

trait WithOptions
{
public static function options(): array
{
return collect(static::cases())->mapWithKeys(function ($item) {
return [$item->value => __($item->name)];
})->toArray();
}
}

0 comments on commit df4a240

Please sign in to comment.