Skip to content

Commit

Permalink
log configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsuguimoto committed Jun 6, 2022
1 parent 7499737 commit e264afc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions config/gates.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@
'classes' => [
// App\Policies\SomePolicy::class,
],

'middleware' => [
'gate_optional' => [
'log_no_gates' => true,
]
]
];
8 changes: 5 additions & 3 deletions src/Middlewares/GateOptional.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ class GateOptional extends Gate
{
protected function noGate($routeName)
{
logger()->info(
"[fireworkweb/laravel-gates] No matching gate for '{$routeName}' route."
);
if (config('middleware.gate_optional.log_no_gates')) {
logger()->info(
"[fireworkweb/laravel-gates] No matching gate for '{$routeName}' route."
);
}
}
}

0 comments on commit e264afc

Please sign in to comment.