Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
48 | public function withTemporaryTable(string $name, \Closure $table, array $data, \Closure $query) |
||
49 | { |
||
50 | \Illuminate\Support\Facades\Schema::create($name, function(\Illuminate\Database\Schema\Blueprint $callback) use ($table) { |
||
51 | $table($callback); |
||
52 | $callback->temporary(); |
||
53 | }); |
||
54 | |||
55 | \Illuminate\Support\Facades\DB::table($name)->insert($data); |
||
56 | |||
57 | $results = $query($this->query(), $name); |
||
58 | |||
59 | \Illuminate\Support\Facades\Schema::dropIfExists($name); |
||
60 | |||
61 | return $results; |
||
62 | } |
||
63 | } |