Skip to content

Commit 0b52acb

Browse files
authored
Allow passing enum to Database attribute (#56688)
1 parent 6d5dfad commit 0b52acb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Container/Attributes/Database.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
use Attribute;
66
use Illuminate\Contracts\Container\Container;
77
use Illuminate\Contracts\Container\ContextualAttribute;
8+
use UnitEnum;
89

910
#[Attribute(Attribute::TARGET_PARAMETER)]
1011
class Database implements ContextualAttribute
1112
{
1213
/**
1314
* Create a new class instance.
1415
*/
15-
public function __construct(public ?string $connection = null)
16+
public function __construct(public UnitEnum|string|null $connection = null)
1617
{
1718
}
1819

0 commit comments

Comments
 (0)