LaravelDaily / laravel-permission-ui

81 stars 18 forks source link

need 'display_name' to display field 'name' #4

Closed donny26utama closed 2 years ago

krekas commented 2 years ago

@donny26utama what are you talkint about?

donny26utama commented 2 years ago

maybe I post this issue in spatie/laravel-permission but in UI we need more readable image permission 'users_create' more readable for user with 'Create an User', in my opinion. maybe we need some text different name to permission. and grouping name too (in the picture 'User')

krekas commented 2 years ago

Sorry, still don't understand what is the problem

donny26utama commented 2 years ago

I think this is a feature request, image rather than show the field 'name', sometimes we need text to explain that permission. for example, I have a page to manage Customers. this page only can access by a user/role that has permission 'manage_customer' on the page to assign this permission, I think rather than use the field 'name' on the checkbox label, we can use the 'display_name' field as a label. I hope we can do like this:

<label for="{{$permission->name}}">
    <input type="checkbox" name="permission[]" value="{{$permissoin->name}}"> {{$permission->display_name}}
</label>

if we use case 'manage_customer'

<label for="manage_customer">
    <input type="checkbox" name="permissions[]" value="manage_customer}"> Can Manage Customer
</label>
krekas commented 2 years ago

It's a custom thing and I think you should do it yourself, because spatie/laravel-permission doesn't have field for description or some other extra data. Either by extending spatie package or doing from scratch

PovilasKorop commented 2 years ago

@donny26utama yes I understand what you're saying but then, as @krekas is saying, it's the issue for the BACK-END package to save that data, which is the Spatie package. For this package, the vision is UI, without changing the DB structure.

donny26utama commented 2 years ago

yeah, I understand. I just want to share something in my head when you want to make UI manage RBAC. We hope Spatie can handle this case in their way. Thanks for your comments. Nice job.

donnyatspe commented 2 years ago

I see on your youtube video comment, someone asking about same with me. "nice_name" for non dev user.