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 924529c commit b6a3850Copy full SHA for b6a3850
src/Middleware/Ip.php
@@ -4,16 +4,21 @@
4
5
use Akaunting\Firewall\Abstracts\Middleware;
6
use Akaunting\Firewall\Models\Ip as Model;
7
-use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\QueryException;
8
9
class Ip extends Middleware
10
{
11
public function check($patterns)
12
13
- if (!Schema::hasTable('firewall_ips')) {
14
- return false;
+ $status = false;
+
15
+ try {
16
+ $status = Model::blocked($this->ip())->pluck('id')->first();
17
+ } catch (QueryException $e) {
18
+ // Base table or view not found
19
+ //$status = ($e->getCode() == '42S02') ? false : true;
20
}
21
- return Model::blocked($this->ip())->pluck('id')->first();
22
+ return $status;
23
24
0 commit comments