File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function getSchemaBuilder(): DbBuilder
46
46
*/
47
47
protected function getDefaultSchemaGrammar (): BaseGrammar
48
48
{
49
- return $ this ->withTablePrefix ((new SchemaGrammar ())-> setConnection ( $ this ));
49
+ return $ this ->withTablePrefix ($ this -> setConnection (new SchemaGrammar ());
50
50
}
51
51
52
52
/**
@@ -77,4 +77,16 @@ protected function getDoctrineDriver()
77
77
{
78
78
return new PostgresDriver ();
79
79
}
80
+
81
+ /**
82
+ * Required to set the connection. This isn't compatible with older Laravel versions
83
+ */
84
+ protected function setConnection (BaseGrammar $ grammar ): BaseGrammar
85
+ {
86
+ if (method_exists ($ grammar , 'setConnection ' )) {
87
+ return $ grammar ->setConnection ($ this );
88
+ }
89
+
90
+ return $ grammar ;
91
+ }
80
92
}
You can’t perform that action at this time.
0 commit comments