We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92c29e8 commit 0e81369Copy full SHA for 0e81369
src/Services/FileMakerConnection.php
@@ -874,7 +874,21 @@ public function setTimeout($timeout)
874
875
protected function getDefaultQueryGrammar()
876
{
877
- return new FMGrammar;
+ // check if this is laravel 11 or 12
878
+ // Laravel 11 constructs a grammar without any parameters
879
+ // Laravel 12 requires a connection as a constructor parameter
880
+
881
+ $reflectionMethod = new \ReflectionMethod(FMGrammar::class, '__construct');
882
+ $parameterArray = $reflectionMethod->getParameters();
883
884
+ if (count($parameterArray) === 0) {
885
+ // Laravel 11 and earlier
886
+ return new FMGrammar;
887
+ }
888
889
+ // Laravel 12
890
+ return new FMGrammar($this);
891
892
}
893
894
// public function getLayoutMetadata($layout = null)
0 commit comments