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.
2 parents 7499737 + e264afc commit 25d7783Copy full SHA for 25d7783
config/gates.php
@@ -27,4 +27,10 @@
27
'classes' => [
28
// App\Policies\SomePolicy::class,
29
],
30
+
31
+ 'middleware' => [
32
+ 'gate_optional' => [
33
+ 'log_no_gates' => true,
34
+ ]
35
36
];
src/Middlewares/GateOptional.php
@@ -6,8 +6,10 @@ class GateOptional extends Gate
6
{
7
protected function noGate($routeName)
8
9
- logger()->info(
10
- "[fireworkweb/laravel-gates] No matching gate for '{$routeName}' route."
11
- );
+ if (config('middleware.gate_optional.log_no_gates')) {
+ logger()->info(
+ "[fireworkweb/laravel-gates] No matching gate for '{$routeName}' route."
12
+ );
13
+ }
14
}
15
0 commit comments