Hi,
your checkbox is always unchecked, because the third parameter is missing. See: https://laravelcollective.com/docs/5.3/html#checkboxes-and-radio-buttons
noxify said:
Hi,
your checkbox is always unchecked, because the third parameter is missing. See: https://laravelcollective.com/docs/5.3/html#checkboxes-and-radio-buttons
thanks for your answer but when i use true option for third parameter check box state always are checked i want to load state of checked or unchecked from DB like fifth line :
<td>{{ Form::checkbox('roles[]', $roles->id) }}</td>I'm kinda confused as to what you're trying to do here? are you trying to save roles for a user or are you trying to save permissions for each role? This is how normally these three entities relate:
a user has many roles
a role has many permissions
a user has many permission through roles
so you will need a screen with checkboxes to save permissions for a role. and another screen with checkboxes to save roles for a user
astroanu said:
I'm kinda confused as to what you're trying to do here? are you trying to save roles for a user or are you trying to save permissions for each role? This is how normally these three entities relate:
a user has many roles ------------------------------------------>yes a role has many permissions--------------------------------->yes a user has many permission through roles-------------->yes
so you will need a screen with checkboxes to save permissions for a role. and another screen with checkboxes to save roles for a user
I want to save both of them in one screen if it is impossible? can you help me how to save permissions for a role
i found very helpfull link may be it can help you http://laravelcode.com/post/laravel-54-usesr-authorization-with-spatie-laravel-permission
Got step by step solution to implement role and permission from : User role and permission in Laravel
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community