Skip to content

Commit 653dc37

Browse files
committed
wip: add permission slug attribute
1 parent 06c9b66 commit 653dc37

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Models/PostType.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,19 @@ class PostType extends Model implements AdminModel, Translatable
4343

4444
public function getAdminUrlAttribute(): string
4545
{
46-
// TODO: Implement getAdminUrlAttribute() method.
4746
return 'post_type';
4847
}
4948

49+
/**
50+
* Get the permission slug
51+
*
52+
* @return string
53+
*/
54+
public function getPermissionSlugAttribute()
55+
{
56+
return Str::slug($this->slug, '_');
57+
}
58+
5059
public function getTranslatables(): array
5160
{
5261
if (! config('cms.should_translate')) {

0 commit comments

Comments
 (0)