@param \Seat\Web\Http\Validation\UpdateIntelNote $request
@param int                                       $character_id

@return \Illuminate\Http\RedirectResponse
772228
public function postUpdateNote(UpdateIntelNote $request, int $character_id)
    {

        CharacterInfo::updateNote(
            $character_id, $request->input('note_id'),
            $request->input('title'),
            $request->input('note'));

        return redirect()->back()
            ->with('success', 'Note updated!');

    }
177994
public function getContractsData(int $character_id)
    {
        if (! request()->ajax())
            return view('web::character.contacts');

        if (! request()->has('all_linked_characters'))
            return response('required url parameter is missing!', 400);

        if (request('all_linked_characters') === 'false')
            $character_ids = collect($character_id);

        $user_group = User::find($character_id)->group->users
            ->filter(function ($user) {

                return  $user->name !== 'admin' && $user->id !== 1;
            })
            ->pluck('id');

        if (request('all_linked_characters') === 'true')
            $character_ids = $user_group;

        $contracts = $this->getCharacterContracts($character_ids);

        return DataTables::of($contracts)
            ->editColumn('issuer_id', function ($row) {

                $character_id = $row->character_id;

                if ($row->for_corporation){

                    $corporation = CorporationInfo::find($row->issuer_corporation_id) ?: $row->issuer_corporation_id;
                    $character = CharacterInfo::find($row->issuer_id) ?: $row->issuer_id;

                    return view('web::partials.corporation', compact('corporation', 'character_id'))
                        . '<br/>(' . view('web::partials.character', compact('character', 'character_id')) . ')';
                }

                $character = CharacterInfo::find($row->issuer_id) ?: $row->issuer_id;

                return view('web::partials.character', compact('character', 'character_id'));

            })
            ->editColumn('assignee_id', function ($row) {

                if ($row->assignee_id === 0)
                    return  trans('web::seat.public');

                $character_id = $row->character_id;
                $character = CharacterInfo::find($row->assignee_id) ?: null;

                if (! is_null($character))
                    return view('web::partials.character', compact('character', 'character_id'));

                $corporation = CorporationInfo::find($row->assignee_id) ?: null;

                if (! is_null($corporation))
                    return view('web::partials.corporation', compact('corporation', 'character_id'));

                return view('web::partials.unknown', [
                    'unknown_id' => $row->assignee_id,
                    'character_id' => $row->character_id,
                ]);

            })
            ->editColumn('acceptor_id', function ($row) {

                if ($row->acceptor_id === 0)
                    return '';

                $character_id = $row->character_id;
                $character = CharacterInfo::find($row->acceptor_id) ?: null;

                if (! is_null($character))
                    return view('web::partials.character', compact('character', 'character_id'));

                $corporation = CorporationInfo::find($row->acceptor_id) ?: null;

                if (! is_null($corporation))
                    return view('web::partials.corporation', compact('corporation', 'character_id'));

                return view('web::partials.unknown', [
                    'unknown_id' => $row->acceptor_id,
                    'character_id' => $row->character_id,
                ]);

            })
            ->editColumn('type', function ($row) {

                return view('web::partials.contracttype', compact('row'))
                    ->render();
            })
            ->editColumn('price', function ($row) {

                return number($row->price);
            })
            ->editColumn('reward', function ($row) {

                return number($row->reward);
            })
            ->editColumn('collateral', function ($row) {

                return number($row->collateral);
            })
            ->addColumn('contents', function ($row) {

                return view('web::partials.contractcontentsbutton', compact('row'));
            })
            ->addColumn('is_in_group', function ($row) use ($user_group) {

                if (in_array($row->issuer_id, $user_group->toArray()) && in_array($row->acceptor_id, $user_group->toArray()))
                    return true;

                if (in_array($row->issuer_id, $user_group->toArray()) && in_array($row->assignee_id, $user_group->toArray()))
                    return true;

                return false;
            })
            ->filterColumn('issuer_id', function ($query, $keyword) {

                $query->whereIn('a.issuer_id', $this->getIdsForNames($keyword)->toArray());
            })
            ->filterColumn('assignee_id', function ($query, $keyword) {

                $query->whereIn('a.assignee_id', $this->getIdsForNames($keyword)->toArray());
            })
            ->filterColumn('acceptor_id', function ($query, $keyword) {

                $query->whereIn('a.acceptor_id', $this->getIdsForNames($keyword)->toArray());
            })
            ->rawColumns(['issuer_id', 'type', 'contents', 'assignee_id', 'acceptor_id'])
            ->make(true);

    }
727322
public function getCharacterAssets(int $character_id)
    {
        if (! request()->has('all_linked_characters'))
            return abort(500);

        if (request('all_linked_characters') === 'false')
            $character_ids = collect($character_id);

        if (request('all_linked_characters') === 'true')
            $character_ids = User::find($character_id)->group->users
                ->filter(function ($user) {
                    if (! $user->name === 'admin' || $user->id === 1)
                        return false;

                    return true;
                })
                ->pluck('id');

        $assets = $this->getCharacterAssetsBuilder($character_ids);

        return DataTables::of($assets)
            ->editColumn('quantity', function ($row) {
                if ($row->content->count() < 1)
                    return number($row->quantity, 0);
            })
            ->editColumn('item', function ($row) {
                return view('web::character.partials.asset-type', compact('row'));
            })
            ->editColumn('volume', function ($row) {
                return number_metric($row->quantity * optional($row->type)->volume ?? 0) . 'm&sup3';
            })
            ->addColumn('group', function ($row) {
                if ($row->type)
                    return $row->type->group->groupName;

                return 'Unknown';
            })
            ->editColumn('content', function ($row) {
                return view('web::character.partials.content', compact('row'));
            })
            ->rawColumns(['item', 'volume', 'content'])
            ->make(true);
    }
773090
public function getNotesData(int $character_id)
    {

        return DataTables::of(CharacterInfo::getNotes($character_id))
            ->addColumn('actions', function ($row) {

                return view('web::character.intel.partials.notesactions', compact('row'))
                    ->render();
            })
            ->rawColumns(['actions'])
            ->make(true);

    }
360082
public function update(PageRequest $request, Page $page)
    {
        try {
            $attributes = $request->all();

            $page->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('page::page.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('page/page/' . $page->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('page/page/' . $page->getRouteKey()))
                ->redirect();
        }

    }
1134711
public function update(Request $request, $id)
    {
        $this->validate(
            $request,
            [
                'name' => 'required',
                'email' => 'required|string|max:255|email|unique:users,email,' . $id,
                'roles' => 'required'
            ]
        );

        $data = $request->except('password');
        if ($request->has('password')) {
            $data['password'] = bcrypt($request->password);
        }

        $user = User::findOrFail($id);
        $user->update($data);

        $user->roles()->detach();
        foreach ($request->roles as $role) {
            $user->assignRole($role);
        }

        return redirect('admin/users')->with('flash_message', 'User updated!');
    }
992515
public function update($id,Request $request)
    {
        $user_setting = User_setting::findOrfail($id);
    	
        $user_setting->user_id = $request->user_id;
        
        $user_setting->setting_id = $request->setting_id;
        
        $user_setting->notes = $request->notes;
        
        
        $user_setting->save();

        return redirect('user_setting');
    }
173138
public function update(RoleRequest $request, $id)
    {
        $input = $request->except('permissions');

        $record = $this->model->findOrFail($id);

        $record->syncPermissions($request->permissions);

        $record->update($input);

        $this->notify([
            'type' => 'success',
            'title' => 'Successful update!',
            'description' => 'This role is updated successfully.',
        ]);

        return redirect()->back();
    }
1047564
public function update(RoleRequest $request, $id)
    {
        $role = Role::findOrFail($id);

        $role->update($request->all());
        $role->setPermissions($request->permissions);
    }
1139061
public function update($id, EventRequest $request)
    {
        $event = $this->repository->find($id);

        if (empty($event)) {
            Cms::notification('Event not found', 'warning');

            return redirect(route($this->routeBase.'.events.index'));
        }

        $event = $this->repository->update($event, $request->all());
        Cms::notification('Event updated successfully.', 'success');

        if (!$event) {
            Cms::notification('Event could not be saved.', 'warning');
        }

        return redirect(URL::previous());
    }
1093420
private function getCharacterIntelView(Collection $universe_name, int $character_id) : string
    {
        if ($universe_name->has('unknown_id'))
            return $this->getUnknownIntelView($universe_name);

        if (! $universe_name->has('character_id'))
            return '';

        $character = CharacterInfo::find($universe_name['character_id']) ?: $universe_name['character_id'];

        return view('web::partials.character', compact('character', 'character_id'));
    }
331197
public function update(Request $request, $id = null)
    {
        // validate data
        $validator = Validator::make($request->all(), [
            'name'         => 'sometimes|required|string|max:255|unique:roles,name,'.$id,
            'display_name' => 'string|max:255',
            'description'  => 'max:1000'
        ]);

        if ($validator->fails()) {
            return response()->json(arrayView('phpsoft.users::errors/validation', [
                'errors' => $validator->errors()
            ]), 400);
        }

        // check role
        $role = Role::find($id);

        if (!$role) {
            return response()->json(null, 404);
        }

        // update role
        $updateRole = $role->update($request->all());

        if (!$updateRole) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(arrayView('phpsoft.users::role/read', [
            'role' => $role
        ]), 200);
    }
700982
public function update($id, UpdateRequest $request)
	{
		$level = "danger";
		$message = " You are not permitted to update permissions.";

		if ( Shinobi::can ( config('watchtower.acl.permission.edit', false) ) ) {
			$permission = Permission::findOrFail($id);
			$permission->update($request->all());
			$level = "success";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! Permission edited.";
		}

		return redirect()->route( config('watchtower.route.as') .'permission.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
151997
public function update(Request $request, $id = null)
    {
        // validate
        $this->registerValidators();

        // check auth if update me
        if (!$id && !$this->checkAuth()) {
            return response()->json(null, 401);
        }

        // check user
        $user = $id ? AppUser::find($id) : Auth::user();

        if (!$user) {
            return response()->json(null, 404);
        }

        $request->id = $id;
        // validate data
        $validator = Validator::make($request->all(), [
            'name'         => 'sometimes|required|max:255',
            'email'        => 'sometimes|required|email|max:255|unique:users,email,'.$user->id,
            'old_password' => 'sometimes|required|changePassword|min:6',
            'password'     => 'sometimes|required|changePassword|confirmed|min:6',
            'username'     => 'string|max:30',
            'country'      => 'string|max:100',
            'location'     => 'string|max:100',
            'biography'    => 'string|max:255',
            'occupation'   => 'string|max:255',
            'website'      => 'string|max:255',
            'image'        => 'string|max:255',
            'gender'       => 'integer',
            'birthday'     => 'date'
        ]);

        if ($validator->fails()) {
            return response()->json(arrayView('phpsoft.users::errors/validation', [
                'errors' => $validator->errors()
            ]), 400);
        }

        // Update profile
        $user = $user->update($request->all());

        if (!$user) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(arrayView('phpsoft.users::user/read', [
            'user' => $user
        ]), 200);
    }
553
public function updateAction(Request $request, $id)
    {
        $this->checkCsrf();

        $transUnit = $this->get('lexik_translation.data_grid.request_handler')->updateFromRequest($id, $request);

        return $this->get('lexik_translation.data_grid.formatter')->createSingleResponse($transUnit);
    }
10910
public function update(SeoPagesRequest $request, $id)
    {
        $input = $request->all();

        $record = $this->model->findOrFail($id);

        $record->update($input);

        $this->notify([
            'type' => 'success',
            'title' => 'Successful update!',
            'description' => 'SeoPage is updated successfully.',
        ]);

        return redirect()->back();
    }
866037
public function update(Request $request, $id)
    {
      if ( \Auth::user()->roles[0]->can('menu-update' ) ) {
        $input = $request->all();
        $input['url'] = "admin/".str_plural(Str::lower($input['name'] != 'Dashboard' ? $string=str_replace(" ","_", $input['name']) : ''));
        $menu = $this->menus->findOrFail($id);
        $menu->update($input);
        $menu->roles()->detach();
        foreach ($request->roles as $_id) {
          $role = Role::whereId($_id)->first();
          $menu->assign($role);
        }
        \Session::flash('flash_message', 'Menu updated!');
        return \Redirect::route('admin.menus.index', [
          ])->withMessage(trans('acl::menu.menus-controller-successfully_updated'));
        }
        return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
      }