forked from leo4all/laravel-entrust-role-permission-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.blade.php
48 lines (44 loc) · 1.86 KB
/
index.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@extends('app')
@section('content')
{!! Form::open(['url' => '/role_permission']) !!}
<table class="table table-striped">
<thead>
<tr>
<th> </th>
<th>Route</th>
@foreach($roles as $role)
<th class="text-center">{{ $role->display_name }}</th>
@endforeach
</tr>
<tr>
<th> </th>
<th> </th>
<th colspan="{{ count($roles) }}"> </th>
</tr>
</thead>
<tbody>
@foreach($permissions as $permission)
<tr>
<td width="150">{{ $permission->display_name }}</td>
<td><small class="label label-info">{{ $permission->route }}</small></td>
@foreach ($roles as $role)
<td width="150" class="text-center">
@if ($permission->hasRole($role->name) && $role->name == 'admin')
<input type="checkbox" checked="checked" name="roles[{{ $role->id}}][permissions][]" value="{{ $permission->id }}" disabled="disabled">
<input type="hidden" name="roles[{{ $role->id}}][permissions][]" value="{{ $permission->id }}">
@elseif($permission->hasRole($role->name))
<input type="checkbox" checked="checked" name="roles[{{ $role->id}}][permissions][]" value="{{ $permission->id }}">
@else
<input type="checkbox" name="roles[{{ $role->id }}][permissions][]" value="{{ $permission->id }}">
@endif
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
<div class="form-group">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
</div>
{!! Form::close() !!}
@stop