Skip to content

Instantly share code, notes, and snippets.

@SeoRoman
Created May 9, 2016 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeoRoman/5426e4317a2dc31c5601472bdd3280c5 to your computer and use it in GitHub Desktop.
Save SeoRoman/5426e4317a2dc31c5601472bdd3280c5 to your computer and use it in GitHub Desktop.
<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