Skip to content

Commit 1b67125

Browse files
committed
Support Laravel 12
1 parent 6255bed commit 1b67125

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
],
1717
"require": {
1818
"php" : "^7.2|^8.0",
19-
"illuminate/database": "5.*|6.*|7.*|8.*|9.*|10.*|11.*",
20-
"illuminate/events": "5.*|6.*|7.*|8.*|9.*|10.*|11.*"
19+
"illuminate/database": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*",
20+
"illuminate/events": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^7.5.20|^8.5.28|^9.5",

src/FakeConnection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Closure;
66
use Illuminate\Database\Connection;
77
use Illuminate\Database\ConnectionInterface;
8+
use Illuminate\Database\Schema\Blueprint;
89
use Illuminate\Database\Schema\MySqlBuilder;
910
use Illuminate\Support\Arr;
1011

@@ -16,7 +17,7 @@ public static function resolve($connection = null, $db = '', $prefix = '', $conf
1617
return new FakePDO;
1718
}, $db, $prefix, $config);
1819

19-
$fakeConnection->setQueryGrammar(new FakeGrammar);
20+
$fakeConnection->setQueryGrammar(new FakeGrammar($fakeConnection));
2021

2122
return $fakeConnection;
2223
}
@@ -45,7 +46,7 @@ public function query()
4546

4647
protected function getDefaultQueryGrammar()
4748
{
48-
return new FakeGrammar;
49+
return new FakeGrammar($this);
4950
}
5051

5152
public function statement($query, $bindings = [])

src/FakeDB.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Database\ConnectionResolver;
88
use Illuminate\Database\Eloquent\Model;
99
use Illuminate\Database\Query\Expression;
10+
use Illuminate\Database\Schema\Blueprint;
1011
use Illuminate\Support\Arr;
1112
use Illuminate\Support\Collection;
1213
use Illuminate\Support\Str;

src/FakeSchemaGrammar.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ public function compileColumnListing()
9797
return parent::compileColumnListing();
9898
}
9999

100+
public function compileTableListing($schema = null, $schemaQualified = true)
101+
{
102+
return $this->stringy([
103+
'type' => 'getAllTables',
104+
'sql' => parent::compileTableListing($schema, $schemaQualified),
105+
]);
106+
}
107+
100108
public function compileGetAllTables()
101109
{
102110
return $this->stringy([

0 commit comments

Comments
 (0)