Controller:
public function useredit($id){
$user = User::FindOrFail($id);
// return $user->roles->pluck('id')->all();
$allroles = Sentinel::getRoleRepository()->pluck('name','id');
return view('admin.edit',compact('allroles','user'));
View:
{!! Form::label('RoleList','Wybierz role')!!} {!! Form::select('RoleList[]',$allroles, null,['class' => 'form-control','multiple'])!!}
@if ($errors->has('RoleList'))
@endif
EloquentUser
public function getRoleListAttribute(){
return $this->roles->pluck('id')->all();
}
Roles is listting but still selected its not working :/
via Marcin Maj