-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove gender migration and add Enum Type
- Loading branch information
1 parent
047181e
commit c988af6
Showing
6 changed files
with
42 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
packages/core/database/migrations/2022_06_14_224741_update_gender_columns_on_users_table.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shopper\Core\Enum; | ||
|
||
use Filament\Support\Contracts\HasLabel; | ||
use Shopper\Core\Traits\HasEnumStaticMethods; | ||
|
||
/** | ||
* @method static string Male() | ||
* @method static string Female() | ||
*/ | ||
enum GenderType: string implements HasLabel | ||
{ | ||
use HasEnumStaticMethods; | ||
|
||
case Male = 'male'; | ||
|
||
case Female = 'female'; | ||
|
||
public function getLabel(): ?string | ||
{ | ||
return match ($this) { | ||
self::Male => __('shopper::words.male'), | ||
self::Female => __('shopper::words.female'), | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters