コード例 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show()
 {
     return Datatable::collection(Role::all())->showColumns('id', 'role_title', 'role_slug')->searchColumns('id', 'role_title', 'role_slug')->orderColumns('id', 'role_title', 'role_slug')->addColumn('Actions', function ($model) {
         return '<a href="roles/' . $model->id . '/edit" class="btn btn-info pull-left"><span class="glyphicon glyphicon-pencil"></span> ' . trans('admin/roles.show.edit') . '</a>&nbsp;&nbsp;
                 <a href="#" class="btn btn-danger" data-toggle="modal" data-target="#confirm-delete" id=' . $model->id . '><span class="glyphicon glyphicon-trash"></span> ' . trans('admin/roles.show.delete') . '</a>';
     })->make();
 }
コード例 #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $roles = Role::all()->lists('acronym', 'id');
     $model = $this->getModel($id);
     $model_roles = $model->roles->lists('id');
     return view($this->edit_view, compact(['model', 'roles', 'model_roles']));
 }
コード例 #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = User::find($id);
     $action = 'admin.users.update';
     $countries = ['0' => trans('admin/users.form.country.placeholder')];
     $countries = array_merge($countries, Countries::all()->lists('name', 'id')->toArray());
     $roles = Role::all()->toArray();
     $role_user_array = $user->roles->toArray();
     $col_md = count($roles) >= 4 ? '3' : '4';
     //Number of columns depending of roles
     if ($role_user_array) {
         //Save only the user role id
         foreach ($role_user_array as $key => $value) {
             $role_user[] = $value['id'];
         }
     } else {
         $role_user = array();
     }
     return View('admin.users.edit', compact('user', 'action', 'countries', 'roles', 'role_user', 'col_md'));
 }
コード例 #4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $manageRow = Manage::find($id);
     return view('admin.rbac.manage.create')->with('manageRow', $manageRow)->with('roleRows', Role::all())->with('roleCheckeds', array_fetch($manageRow->roles->toArray(), 'id'));
 }
コード例 #5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = User::find($id);
     $action = 'admin.users.update';
     $roles = Role::all()->toArray();
     $role_user_array = $user->roles->toArray();
     $col_md = count($roles) >= 4 ? '3' : '4';
     //Number of columns depending of roles
     if ($role_user_array) {
         //Save only the user role id
         foreach ($role_user_array as $key => $value) {
             $role_user[] = $value['id'];
         }
     } else {
         $role_user = array();
     }
     return View('admin.users.edit', compact('user', 'action', 'roles', 'role_user', 'col_md'));
 }