File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1111 "license" : " MIT" ,
1212 "require" : {
1313 "php" : " ^8.0" ,
14+ "doctrine/dbal" : " ^3.0|^4.0" ,
1415 "illuminate/support" : " ^8.0|^9.0|^10.0|^11.0|^12.0"
1516 },
1617 "require-dev" : {
Original file line number Diff line number Diff line change @@ -20,15 +20,15 @@ class ModelConfig
2020 public function __construct (Model $ model )
2121 {
2222 $ this ->model = $ model ;
23- $ this ->config = $ this ->hasConfig () ? $ this ->getConfig () : [];
24-
23+ $ this ->config = $ this ->hasConfig () ? $ this ->getConfig () : [];
2524 }
2625
2726
28- public function getPrimaryColumn (): string {
27+ public function getPrimaryColumn (): string
28+ {
2929 $ table = $ this ->model ->getTable ();
3030 $ primaryKey = $ this ->model ->getKeyName ();
31- return $ table . '. ' . $ primaryKey ;
31+ return $ table . '. ' . $ primaryKey ;
3232 }
3333
3434 /**
@@ -166,8 +166,11 @@ protected function registerEnumTypeForDoctrine($connection): void
166166 return ;
167167 }
168168
169- $ connection
170- ->getDoctrineSchemaManager ()
169+ $ schema = method_exists ($ connection , 'createSchemaManager ' )
170+ ? $ connection ->createSchemaManager ()
171+ : $ connection ->getDoctrineSchemaManager ();
172+
173+ $ schema
171174 ->getDatabasePlatform ()
172175 ->registerDoctrineTypeMapping ('enum ' , 'string ' );
173176 }
You can’t perform that action at this time.
0 commit comments