base-laravel/resources/views/roles/index.blade.php

54 lines
1.5 KiB
PHP

@extends('layouts.default')
@section('title', '| Roles')
@section('content')
<div class="col-lg-10 col-lg-offset-1">
<div class="panel panel-default">
<div class="panel-heading"><h1>Role Administration</h1></div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Operations</th>
</tr>
</thead>
<tbody>
@foreach ($roles as $role)
<tr>
<td>{{ $role->name }}</td>
<td>{{ $role->description }}</td>
<td>
@if(in_array('EditRole',$allperms))
<a href="{{ route('roles.edit', $role->id) }}" class="btn btn-info pull-left" style="margin-right: 3px;">Edit</a>
@endif
@if(in_array('DeleteRole',$allperms))
{!! Form::open(['method' => 'DELETE', 'route' => ['roles.destroy', $role->id] ]) !!}
{!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
{!! Form::close() !!}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if(in_array('CreateRole',$allperms))
<a href="{{ route('roles.create') }}" class="btn btn-success">Add Role</a>
@endif
</div>
</div>
</div>
@endsection