@extends('backend.layouts_backend.master2') @section('title') Add Role @endsection @section('content') {{-- header --}}

All Roles

@if (Auth::user()->can('role-create')) @endif @if (Auth::user()->can('role-list')) @endif
{{-- end header --}}
{!! Form::model($role, ['method' => 'PATCH', 'route' => ['roles.update', $role->id]]) !!}
{{ Form::text('name', null, ['class' => 'form-control compulsory']) }} {{-- {!! Form::text('name', null, ['placeholder' => 'Name', 'class' => 'form-control']) !!} --}}
@if ($errors->has('name')) @endif

Assign permissions to role


@if ($errors->has('permission')) {{-- {{ $errors->first('permission') }} --}} @endif
@foreach ($categories as $category) {{-- --}} @php $permissions = \App\Models\PermissionCategory::find($category->id) ->permissions; @endphp {{-- --}} @endforeach
# {{ __('roles.assign') }}{{ $category->name }}
  • {{ __('roles.viewing') }}
  • {{ __('roles.creating') }}
  • {{ __('roles.editing') }}
  • {{ __('roles.deleting') }}
  • {{ __('roles.other') }}
@foreach ($permissions->chunk(3) as $permission)
@foreach ($permission as $item)
{{-- {{ Form::checkbox('permission[]', $item->id, false, ['class' => "permission{$category->id}"]) }} --}}
@endforeach
@endforeach

{{-- {{ Form::button(__('Submit'), ['type' => 'submit', 'class' => 'btn btn-success waves-effect waves-light m-r-10']) }} --}}
{!! Form::close() !!}
@endsection