Skip to content

Commit 924529c

Browse files
committed
check if table exists
1 parent 5dfcf79 commit 924529c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Middleware/Ip.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
use Akaunting\Firewall\Abstracts\Middleware;
66
use Akaunting\Firewall\Models\Ip as Model;
7+
use Illuminate\Support\Facades\Schema;
78

89
class Ip extends Middleware
910
{
1011
public function check($patterns)
1112
{
13+
if (!Schema::hasTable('firewall_ips')) {
14+
return false;
15+
}
16+
1217
return Model::blocked($this->ip())->pluck('id')->first();
1318
}
1419
}

0 commit comments

Comments
 (0)