Skip to content

Commit 82f872a

Browse files
authored
Merge pull request #185 from tylerwiegand/patch-2
Update Role.php
2 parents c998a1b + e4a8f8b commit 82f872a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Kodeine/Acl/Models/Eloquent/Role.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ class Role extends Model
2121
*/
2222
protected $table = 'roles';
2323

24+
/**
25+
* Use the slug of the Role
26+
* instead of the ID.
27+
*
28+
* @return string
29+
*/
30+
public function getRouteKeyName() {
31+
return 'slug';
32+
}
33+
2434
/**
2535
* Roles can belong to many users.
2636
*
@@ -115,4 +125,4 @@ protected function canWithOr($permission, $permissions)
115125
return false;
116126
}
117127

118-
}
128+
}

0 commit comments

Comments
 (0)