Skip to content

Commit a0625ea

Browse files
author
Christian Blanquera
committed
permanent remove fix
1 parent 15a42af commit a0625ea

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/Schema/Service/SqlService.php

-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ public function getResource()
171171
*/
172172
public function remove($restorable = true)
173173
{
174-
175174
//translate model data to sql data
176175
if (is_null($this->schema)) {
177176
throw Exception::forNoSchema();

src/Schema/events.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function ($relation) {
181181

182182
try {
183183
//remove table
184-
$results = $systemSql->remove($data, $restorable);
184+
$results = $systemSql->remove($restorable);
185185
} catch (\Exception $e) {
186186
return $response->setError(true, $e->getMessage());
187187
}

src/bootstrap/schema.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* A helper to manage the schema file system
1818
*/
19-
$package->addMethod('schema', function ($path, array $data = null) {
19+
$package->addMethod('schema', function ($path, $data = null) {
2020
static $cache = [];
2121

2222
//determine file path
@@ -33,6 +33,15 @@
3333
}
3434
}
3535

36+
//if data is false
37+
if ($data === false) {
38+
//they want to remove the cache
39+
$data = $cache[$path];
40+
unset($cache[$path]);
41+
//return the data
42+
return $data;
43+
}
44+
3645
if (is_null($data)) {
3746
//return the data
3847
return $cache[$path];

0 commit comments

Comments
 (0)