Skip to content

Commit 14e4517

Browse files
authored
Fix gate isset key (#1692)
* Check if key is set * Use isset * Fix
1 parent a4e6909 commit 14e4517

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DataCollector/GateCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function addCheck($user, $ability, $result, $arguments = [])
6464
if (isset($arguments[0])) {
6565
if ($arguments[0] instanceof Model) {
6666
$model = $arguments[0];
67-
if ($model->getKeyName() && $model->hasAttribute($model->getKeyName())) {
67+
if ($model->getKeyName() && isset($model[$model->getKeyName()])) {
6868
$target = get_class($model) . '(' . $model->getKeyName() . '=' . $model->getKey() . ')';
6969
} else {
7070
$target = get_class($model);

0 commit comments

Comments
 (0)