forked from laravel/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes explicit route binding with
BackedEnum
Port a078b1a (Fixes explicit route binding with `BackedEnum` (laravel#51525), 2024-05-21 crynobone) to 10.x (from 11.x). fixes laravel#51583 refs laravel#51514 Signed-off-by: CAAHS <[email protected]>
- Loading branch information
CAAHS
authored and
CAAHS
committed
May 27, 2024
1 parent
1d902e9
commit 5edd68e
Showing
4 changed files
with
37 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Integration\Routing; | ||
|
||
enum CategoryBackedEnum: string | ||
{ | ||
case People = 'people'; | ||
case Fruits = 'fruits'; | ||
|
||
public static function fromCode(string $code) | ||
{ | ||
return match ($code) { | ||
'c01' => self::People, | ||
'c02' => self::Fruits, | ||
default => null, | ||
}; | ||
} | ||
} |
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