Skip to content

Instantly share code, notes, and snippets.

@SeoRoman
Created May 9, 2016
Embed
What would you like to do?
<div class="col-sm-10">
<select class="form-control" onchange="event()">
@foreach($group->permissions as $permission)
@if ($role->hasPermission($permission->name))
<option selected value="{{ $permission->id }}">
{{ $permission->display_name }}
<span>{{ $permission->description }}</span>
</option>
@else
<option value="{{ $permission->id }}">{{ $permission->display_name }}</option>
@endif
@endforeach
</select>
<small><code class="permission_description">{{ $permission->description }}</code></small>
</div>
<script>
$(function() {
function event() {
// here I want to update the nearest .permission_description with the permission object's description, but I don't really have access to that...
// Don't know if I should just pass $permission as the value and utilize that way?
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment